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

Added function to normalise date strings #657

Merged
merged 5 commits into from
May 30, 2024

Conversation

keegansmith21
Copy link
Contributor

Added a function to give a generic datetime string for any valid input datetime string.

I made this because I was running into issues when running tests locally. When uploading to Bigquery, the string will change format to +0000UTC, regardless of what the timezone of the local string is.

The idea is to put both the local and the uploaded version of the strings through the normalising function and they should always be the same if they represent identical datetimes.

@keegansmith21 keegansmith21 requested a review from jdddog May 27, 2024 07:52
Copy link
Contributor

@jdddog jdddog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR Keegan.

Perhaps it would be better to use pendulum, which is already installed, rather than installing a new package?

You can use pendulum.parse("your-date-time", strict=False) to parse the date.

@keegansmith21 keegansmith21 requested a review from jdddog May 28, 2024 06:07
Copy link
Contributor

@jdddog jdddog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Keegan!

@jdddog jdddog merged commit 17e2949 into feature/astro-refactor May 30, 2024
2 checks passed
@jdddog jdddog deleted the normalised_dates branch May 30, 2024 05:30
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.

None yet

2 participants