Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: "None" in key path when no prefix is specified #43

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ReubenFrankel
Copy link

@ReubenFrankel ReubenFrankel commented Sep 13, 2024

Previously, if you didn't specify prefix config you would end up with a file path containing None

2024-09-13 12:19:31,494 | INFO     | target-s3            | key: my-bucket/None/my-stream/.jsonl.gz

or duplicate forward slashes if set to an empty string

2024-09-13 12:19:31,494 | INFO     | target-s3            | key: my-bucket//my-stream/.jsonl.gz

both of which result in an undesirable structure in S3:

image

This change handles prefix optionally for the key, using pathlib to normalise the path.

2024-09-13 12:42:10,206 | INFO     | target-s3            | key: my-bucket/my-stream.jsonl.gz

A similar issue was resolved where the file name stem in the generated key path ended with a slash (as above) when disabling some of the append_ settings:

image


Fixes #19

@ReubenFrankel
Copy link
Author

Related to #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty file name when append_date_to_filename=False
1 participant