Taragolis commented on PR #35448:
URL: https://github.com/apache/airflow/pull/35448#issuecomment-1918810654
There is still remaining usage into the dev and providers tests, which I've
plan to fix as follow up.
And after that we could ban `datetime.datetime.utcnow` import and usage on
entire project by add into the `tool.ruff.flake8-tidy-imports.banned-api` rule
```toml
[tool.ruff.flake8-tidy-imports.banned-api]
...
"datetime.datetime.utcnow".msg = "Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)"
```
```console
❯ pre-commit run ruff --all-files
Run 'ruff' for extremely fast Python
linting.............................Failed
- hook id: ruff
- exit code: 1
airflow/providers/google/cloud/transfers/s3_to_gcs.py:279:15: TID251
`datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)
airflow/providers/google/common/hooks/base_google.py:673:41: TID251
`datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)
dev/breeze/src/airflow_breeze/utils/parallel.py:286:27: TID251
`datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)
dev/breeze/src/airflow_breeze/utils/parallel.py:315:23: TID251
`datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)
kubernetes_tests/test_base.py:80:32: TID251 `datetime.datetime.utcnow` is
banned: Use airflow.utils.timezone.utcnow or datetime.datetime.utc(tz=...)
scripts/in_container/update_quarantined_test_status.py:239:26: TID251
`datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)
Found 6 errors.
tests/providers/celery/executors/test_celery_executor.py:186:22: TID251
`datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)
tests/providers/cncf/kubernetes/executors/test_kubernetes_executor.py:453:37:
TID251 `datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow
or datetime.datetime.utc(tz=...)
tests/providers/cncf/kubernetes/executors/test_kubernetes_executor.py:1420:48:
TID251 `datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow
or datetime.datetime.utc(tz=...)
tests/providers/cncf/kubernetes/executors/test_kubernetes_executor.py:1450:48:
TID251 `datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow
or datetime.datetime.utc(tz=...)
tests/providers/cncf/kubernetes/executors/test_kubernetes_executor.py:1484:48:
TID251 `datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow
or datetime.datetime.utc(tz=...)
tests/providers/google/cloud/sensors/test_gcs.py:75:37: TID251
`datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)
tests/providers/google/cloud/triggers/test_gcs.py:44:18: TID251
`datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow or
datetime.datetime.utc(tz=...)
tests/system/providers/google/cloud/storage_transfer/example_cloud_storage_transfer_service_aws.py:90:29:
TID251 `datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow
or datetime.datetime.utc(tz=...)
tests/system/providers/google/cloud/storage_transfer/example_cloud_storage_transfer_service_gcp.py:86:29:
TID251 `datetime.datetime.utcnow` is banned: Use airflow.utils.timezone.utcnow
or datetime.datetime.utc(tz=...)
Found 9 errors.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]