Skip to content

[flake8-datetimez] Usages of datetime.max/datetime.min (DTZ901)#14288

Merged
charliermarsh merged 9 commits intoastral-sh:mainfrom
InSyncWithFoo:DTZ901
Nov 12, 2024
Merged

[flake8-datetimez] Usages of datetime.max/datetime.min (DTZ901)#14288
charliermarsh merged 9 commits intoastral-sh:mainfrom
InSyncWithFoo:DTZ901

Conversation

@InSyncWithFoo
Copy link
Copy Markdown
Contributor

Summary

Resolves #13217.

Test Plan

cargo nextest run and cargo insta test.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 12, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+13 -0 violations, +0 -0 fixes in 2 projects; 52 projects unchanged)

apache/airflow (+12 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ airflow/example_dags/example_inlet_event_extra.py:38:16: DTZ901 Use of `datetime.datetime.min` without timezone information
+ airflow/example_dags/example_inlet_event_extra.py:53:16: DTZ901 Use of `datetime.datetime.min` without timezone information
+ airflow/example_dags/example_outlet_event_extra.py:39:16: DTZ901 Use of `datetime.datetime.min` without timezone information
+ airflow/example_dags/example_outlet_event_extra.py:53:16: DTZ901 Use of `datetime.datetime.min` without timezone information
+ airflow/example_dags/example_outlet_event_extra.py:67:16: DTZ901 Use of `datetime.datetime.min` without timezone information
+ providers/src/airflow/providers/google/cloud/operators/gcs.py:807:46: DTZ901 Use of `datetime.datetime.max` without timezone information
+ providers/src/airflow/providers/google/cloud/operators/gcs.py:810:46: DTZ901 Use of `datetime.datetime.max` without timezone information
+ providers/src/airflow/providers/google/cloud/transfers/mysql_to_gcs.py:129:26: DTZ901 Use of `datetime.datetime.min` without timezone information
+ tests/cli/commands/test_dag_command.py:383:37: DTZ901 Use of `datetime.datetime.max` without timezone information
+ tests/dag_processing/test_job_runner.py:773:53: DTZ901 Use of `datetime.datetime.min` without timezone information
+ tests/dag_processing/test_job_runner.py:804:53: DTZ901 Use of `datetime.datetime.max` without timezone information
+ tests/models/test_dag.py:2451:24: DTZ901 Use of `datetime.datetime.min` without timezone information

bokeh/bokeh (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ examples/models/daylight.py:83:12: DTZ901 Use of `datetime.datetime.min` without timezone information

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
DTZ901 13 13 0 0 0

Copy link
Copy Markdown
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Neat

@MichaReiser MichaReiser added rule Implementing or modifying a lint rule preview Related to preview mode features labels Nov 12, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) November 12, 2024 20:34
@charliermarsh charliermarsh merged commit 5c548dc into astral-sh:main Nov 12, 2024
@InSyncWithFoo InSyncWithFoo deleted the DTZ901 branch November 12, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Related to preview mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report DTZ violation on datetime.datetime.max and min

3 participants