Repository navigation
[flake8-import-conventions] Add datetime as dt as a conventional alias (ICN001) - #28790
Merged
Merged
Conversation
β¦alias (`ICN001`) Summary -- Closes #28604 by adding the alias. This alias is now being recommended in the CPython docs for 3.13+. See https://docs.python.org/3.13/library/datetime.html#datetime.timedelta as one of many examples on the page. Test Plan -- Updated existing test
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| ICN001 | 632 | 632 | 0 | 0 | 0 |
Linter (preview)
βΉοΈ ecosystem check detected linter changes. (+632 -0 violations, +0 -0 fixes in 17 projects; 42 projects unchanged)
DisnakeDev/disnake (+34 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ disnake/activity.py:5:8: unconventional-import-alias `datetime` should be imported as `dt` + disnake/audit_logs.py:35:12: unconventional-import-alias `datetime` should be imported as `dt` + disnake/automod.py:5:8: unconventional-import-alias `datetime` should be imported as `dt` + disnake/channel.py:6:8: unconventional-import-alias `datetime` should be imported as `dt` + disnake/embeds.py:5:8: unconventional-import-alias `datetime` should be imported as `dt` + disnake/entitlement.py:5:8: unconventional-import-alias `datetime` should be imported as `dt` + disnake/ext/commands/base_core.py:6:8: unconventional-import-alias `datetime` should be imported as `dt` + disnake/ext/commands/core.py:6:8: unconventional-import-alias `datetime` should be imported as `dt` + disnake/ext/tasks/__init__.py:6:8: unconventional-import-alias `datetime` should be imported as `dt` + disnake/guild.py:6:8: unconventional-import-alias `datetime` should be imported as `dt` ... 24 additional changes omitted for project
apache/airflow (+234 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
+ airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:20:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/cli/commands/dag_command.py:23:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/cli/utils.py:29:12: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_custom_weight.py:22:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_inlet_event_extra.py:26:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_latest_only_with_trigger.py:25:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_outlet_event_extra.py:26:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_params_trigger_ui.py:25:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_params_ui_tutorial.py:27:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_passing_params_via_test_command.py:22:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_skip_dag.py:22:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/example_dags/example_time_delta_sensor_async.py:24:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/models/taskreschedule.py:22:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/models/taskreschedule.py:39:12: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/models/trigger.py:19:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/serialization/decoders.py:21:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/serialization/definitions/baseoperator.py:21:8: unconventional-import-alias `datetime` should be imported as `dt` + airflow-core/src/airflow/serialization/definitions/dag.py:68:12: unconventional-import-alias `datetime` should be imported as `dt` ... 216 additional changes omitted for project
apache/superset (+15 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
+ superset/common/utils/dataframe_utils.py:19:8: unconventional-import-alias `datetime` should be imported as `dt` + superset/extensions/metadb.py:41:8: unconventional-import-alias `datetime` should be imported as `dt` + superset/mcp_service/system/tool/generate_bug_report.py:29:8: unconventional-import-alias `datetime` should be imported as `dt` + superset/mcp_service/system/tool/health_check.py:20:8: unconventional-import-alias `datetime` should be imported as `dt` + superset/migrations/versions/2018-07-05_15-19_3dda56f1c4c6_migrate_num_period_compare_and_period_.py:27:8: unconventional-import-alias `datetime` should be imported as `dt` + superset/result_set.py:19:8: unconventional-import-alias `datetime` should be imported as `dt` + superset/security/manager.py:20:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/integration_tests/celery_tests.py:20:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/integration_tests/core_tests.py:19:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/integration_tests/dao/base_dao_test.py:30:8: unconventional-import-alias `datetime` should be imported as `dt` ... 5 additional changes omitted for project
bokeh/bokeh (+11 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
+ examples/server/app/weather/main.py:10:8: unconventional-import-alias `datetime` should be imported as `dt` + scripts/milestone.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + src/bokeh/_types.pyi:9:8: unconventional-import-alias `datetime` should be imported as `dt` + src/bokeh/core/property/datetime.py:24:8: unconventional-import-alias `datetime` should be imported as `dt` + src/bokeh/core/property/visual.py:25:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/unit/bokeh/core/property/test_aliases.py:20:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/unit/bokeh/core/property/test_dataspec.py:20:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/unit/bokeh/core/property/test_datetime.py:20:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/unit/bokeh/core/property/test_visual.py:21:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/unit/bokeh/plotting/test__plot.py:20:8: unconventional-import-alias `datetime` should be imported as `dt` ... 1 additional changes omitted for project
ibis-project/ibis (+36 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ ibis/backends/bigquery/tests/system/test_client.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/bigquery/tests/unit/test_compiler.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/clickhouse/converter.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/exasol/__init__.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/exasol/converter.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/flink/utils.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/impala/tests/test_client.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/mssql/__init__.py:6:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/mysql/converter.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + ibis/backends/polars/compiler.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` ... 26 additional changes omitted for project
jrnl-org/jrnl (+6 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ jrnl/journals/DayOneJournal.py:5:8: unconventional-import-alias `datetime` should be imported as `dt` + jrnl/journals/Entry.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + jrnl/journals/Journal.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + jrnl/time.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/unit/test_journals_folder_journal.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + tests/unit/test_time.py:4:8: unconventional-import-alias `datetime` should be imported as `dt`
langchain-ai/langchain (+6 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ libs/core/langchain_core/document_loaders/langsmith.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + libs/core/langchain_core/utils/utils.py:4:8: unconventional-import-alias `datetime` should be imported as `dt` + libs/core/tests/unit_tests/document_loaders/test_langsmith.py:1:8: unconventional-import-alias `datetime` should be imported as `dt` + libs/langchain/langchain_classic/chains/query_constructor/parser.py:1:8: unconventional-import-alias `datetime` should be imported as `dt` + libs/langchain/langchain_classic/retrievers/time_weighted_retriever.py:1:8: unconventional-import-alias `datetime` should be imported as `dt` + libs/partners/anthropic/langchain_anthropic/chat_models.py:6:8: unconventional-import-alias `datetime` should be imported as `dt`
latchbio/latch (+3 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ docs/source/conf.py:9:8: unconventional-import-alias `datetime` should be imported as `dt` + src/latch/registry/record.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + src/latch/resources/tasks.py:27:8: unconventional-import-alias `datetime` should be imported as `dt`
milvus-io/pymilvus (+14 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ examples/bulk_import/bulk_writer_all_types.py:1:8: unconventional-import-alias `datetime` should be imported as `dt` + examples/timestamptz.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + examples/timestamptz_insert.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + examples/timestamptz_meta.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + examples/timestamptz_search_query.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + pymilvus/client/check.py:1:8: unconventional-import-alias `datetime` should be imported as `dt` + pymilvus/client/iterator/query_iterator.py:3:8: unconventional-import-alias `datetime` should be imported as `dt` + pymilvus/client/prepare.py:2:8: unconventional-import-alias `datetime` should be imported as `dt` + pymilvus/client/ts_utils.py:1:8: unconventional-import-alias `datetime` should be imported as `dt` + pymilvus/client/utils.py:1:8: unconventional-import-alias `datetime` should be imported as `dt` ... 4 additional changes omitted for project
... Truncated remaining completed project reports due to GitHub comment length restrictions
Changes by rule (1 rules affected)
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| unconventional-import-alias | 632 | 632 | 0 | 0 | 0 |
ntBre
added a commit
that referenced
this pull request
Sep 25, 2026
β¦alias (`ICN001`) (#28790) Summary -- Closes #28604 by adding the alias. This alias is now being recommended in the CPython docs for 3.13+. See https://docs.python.org/3.13/library/datetime.html#datetime.timedelta as one of many examples on the page. Test Plan -- Updated existing test
ntBre
added a commit
that referenced
this pull request
Sep 25, 2026
β¦alias (`ICN001`) (#28790) Summary -- Closes #28604 by adding the alias. This alias is now being recommended in the CPython docs for 3.13+. See https://docs.python.org/3.13/library/datetime.html#datetime.timedelta as one of many examples on the page. Test Plan -- Updated existing test
ntBre
added a commit
that referenced
this pull request
Oct 1, 2026
β¦alias (`ICN001`) (#28790) Summary -- Closes #28604 by adding the alias. This alias is now being recommended in the CPython docs for 3.13+. See https://docs.python.org/3.13/library/datetime.html#datetime.timedelta as one of many examples on the page. Test Plan -- Updated existing test
ntBre
added a commit
that referenced
this pull request
Oct 1, 2026
β¦alias (`ICN001`) (#28790) Summary -- Closes #28604 by adding the alias. This alias is now being recommended in the CPython docs for 3.13+. See https://docs.python.org/3.13/library/datetime.html#datetime.timedelta as one of many examples on the page. Test Plan -- Updated existing test
ntBre
added a commit
that referenced
this pull request
Oct 9, 2026
β¦alias (`ICN001`) (#28790) Summary -- Closes #28604 by adding the alias. This alias is now being recommended in the CPython docs for 3.13+. See https://docs.python.org/3.13/library/datetime.html#datetime.timedelta as one of many examples on the page. Test Plan -- Updated existing test
ntBre
added a commit
that referenced
this pull request
Oct 9, 2026
β¦alias (`ICN001`) (#28790) Summary -- Closes #28604 by adding the alias. This alias is now being recommended in the CPython docs for 3.13+. See https://docs.python.org/3.13/library/datetime.html#datetime.timedelta as one of many examples on the page. Test Plan -- Updated existing test
1 task
CybotTM
added a commit
to netresearch/jira-to-openproject
that referenced
this pull request
Oct 19, 2026
ruff 0.17 adds `datetime as dt` to the default flake8-import-conventions aliases (astral-sh/ruff#28790), so ICN001 now flags the plain `import datetime` in src/utils/file_manager.py and fails the lint step of the ruff 0.17 update. Apply ruff's own fix; nothing patches `file_manager.datetime`, so behaviour is unchanged. Assisted-by: claude-code:claude-opus-5-5 Agent-Session: f80546bb-48c5-4cd1-967d-f275a0a8f88d Agent-Host: 0493f0 Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
1 task
blarghmatey
added a commit
to mitodl/ol-analytics-api
that referenced
this pull request
Nov 5, 2026
ruff 0.17.0 added `datetime as dt` to the default flake8-import-conventions aliases (astral-sh/ruff#28790). With `select = ["ALL"]` every `import datetime` now fails ICN001, which blocks the ruff-pre-commit bump (#118) and lock file maintenance (#105). The rename is ruff's own --unsafe-fixes output; none of the 18 files already bound `dt`. Claude-Session: https://claude.ai/code/session_01FGZebGv1QWb8gnk7RGJqMZ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #28604 by adding the alias. This alias is now being recommended in the CPython docs for
3.13+.
See https://docs.python.org/3.13/library/datetime.html#datetime.timedelta as one of many examples on
the page.
Test Plan
Updated existing test