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

Incorrect output filenames for filenames with periods #64

Open
KaleyWhite opened this issue Jan 13, 2025 · 0 comments
Open

Incorrect output filenames for filenames with periods #64

KaleyWhite opened this issue Jan 13, 2025 · 0 comments

Comments

@KaleyWhite
Copy link

When request_per_day is True and the base output_file name (without the extension) contains periods, the output filenames are incorrect. If the period is in a directory name in the path, then export_eventsraises a FileNotFoundError.

mputils = MixpanelUtils(...)
params = {'from_date': '2024-01-12', 'to_date': '2024-01-13'}
mputils.export_events('test.json', params=params, request_per_day=True)  # Intended behavior
mputils.export_events('test.test.json', params=params, request_per_day=True)  # Export filenames in the format 'test_YYYY-MM-DD.text' instead of 'test.test-YYYY-MM-DD.json'
mputils.export_events('dot.directory/test.json', params=params, request_per_day=True)  # FileNotFoundError: dot_2024-01-12.directory/test

The bug occurs because export_events generates the new filename by splitting along the first instead of the last period in output_file.

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

No branches or pull requests

1 participant