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

Change utcnow to now with time zone #754

Merged
merged 1 commit into from
May 11, 2023
Merged

Change utcnow to now with time zone #754

merged 1 commit into from
May 11, 2023

Conversation

sanders41
Copy link
Collaborator

Pull Request

Related issue

Fixes #753

What does this PR do?

  • Changes utcnow() to now() with a utc time zone.

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@sanders41
Copy link
Collaborator Author

A note on this from some further testing. This is not a true breaking change, but if people have not followed what the doc string says to do it could break. If you send a datetime that does not include the time zone an error is thrown: TypeError: can't compare offset-naive and offset-aware datetimes. The doc string does say to use UTC time so in theory this shouldn't be an issue, but I wanted to point it out in case issues come in later so we will know the solution.

Copy link
Contributor

@alallema alallema left a comment

Choose a reason for hiding this comment

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

Thanks, @sanders41 for this PR 🔥
LGTM!
Regarding the not true breaking, I think adding a note about it in the Changelog to specify it will be enough, thanks for all these details

@alallema
Copy link
Contributor

bors merge

@alallema alallema added enhancement New feature or request maintenance Anything related to maintenance (CI, tests, refactoring...) labels May 11, 2023
@meili-bors
Copy link
Contributor

meili-bors bot commented May 11, 2023

@meili-bors meili-bors bot merged commit f788922 into main May 11, 2023
@meili-bors meili-bors bot deleted the utcnow branch May 11, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintenance Anything related to maintenance (CI, tests, refactoring...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

utcnow function depreciated in Python 3.12
2 participants