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

Prevent RuntimeWarnings about naive datetimes #77

Closed
adamchainz opened this issue Feb 23, 2024 · 0 comments · Fixed by #78
Closed

Prevent RuntimeWarnings about naive datetimes #77

adamchainz opened this issue Feb 23, 2024 · 0 comments · Fixed by #78

Comments

@adamchainz
Copy link
Member

adamchainz commented Feb 23, 2024

Running all benchmarks locally with asv’s --show-stderr option, I saw the below warning repeated many times from query_benchmarks.queryset_filter_chain.benchmark.FilterChain.time_filter_chain:

  warnings.warn(
/.../python3.12/site-packages/django/db/models/fields/__init__.py:1669: RuntimeWarning: DateTimeField Book.date_published received a naive datetime (2024-02-23 15:00:07.507742) while time zone support is active.

It was repeated for both date_created and date_published.

This should be fixed to avoid the possible output spam and ensure the benchmark simulates a typical situation.

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 a pull request may close this issue.

1 participant