From 655f1039a58b6277957c28bc0e46000ca8c9e088 Mon Sep 17 00:00:00 2001 From: Manasa Venkatakrishnan Date: Wed, 16 Oct 2024 06:23:11 -0700 Subject: [PATCH] fix path standardization when bucket name not in path --- ingestion_tools/scripts/common/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ingestion_tools/scripts/common/config.py b/ingestion_tools/scripts/common/config.py index f5d6b7d7c..d9e2b7773 100644 --- a/ingestion_tools/scripts/common/config.py +++ b/ingestion_tools/scripts/common/config.py @@ -251,4 +251,8 @@ def to_formatted_path(self, path: str) -> str: """ Returns the s3 key, without the bucket name, for the given path. Helpful for formatting paths in metadata. """ - return os.path.relpath(path, self.output_prefix) if path else None + if path: + if path.startswith(self.output_prefix): + return os.path.relpath(path, self.output_prefix) + return path + return None