Skip to content

Commit

Permalink
fix path standardization when bucket name not in path
Browse files Browse the repository at this point in the history
  • Loading branch information
manasaV3 committed Oct 16, 2024
1 parent 31ec71a commit 655f103
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ingestion_tools/scripts/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 655f103

Please sign in to comment.