Copilot commented on code in PR #63882:
URL: https://github.com/apache/airflow/pull/63882#discussion_r3025334659
##########
airflow-core/src/airflow/example_dags/example_outlet_event_extra.py:
##########
@@ -33,7 +33,7 @@
with DAG(
dag_id="asset_with_extra_by_yield",
catchup=False,
- start_date=datetime.datetime.min,
+ start_date=datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc),
Review Comment:
`start_date=datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc)` is
duplicated across multiple DAG definitions in this module. Consider extracting
it into a module-level constant (e.g., `START_DATE`) to avoid repetition and
make future changes less error-prone.
##########
airflow-core/src/airflow/example_dags/example_outlet_event_extra.py:
##########
@@ -33,7 +33,7 @@
with DAG(
dag_id="asset_with_extra_by_yield",
catchup=False,
- start_date=datetime.datetime.min,
+ start_date=datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc),
schedule="@daily",
Review Comment:
This change fixes a timezone-dependent import failure, but there’s no
regression coverage to ensure these example DAGs remain importable when `[core]
default_timezone` is set to a non-UTC value (the scenario from #63865).
Consider extending the existing example-DAG import test suite (e.g.,
`airflow-core/tests/unit/always/test_example_dags.py`) to run DagBag import for
this file under a non-UTC default timezone.
##########
airflow-core/src/airflow/example_dags/example_inlet_event_extra.py:
##########
@@ -33,7 +33,7 @@
with DAG(
dag_id="read_asset_event",
catchup=False,
- start_date=datetime.datetime.min,
+ start_date=datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc),
schedule="@daily",
Review Comment:
This file is part of the timezone-overflow fix, but the current test suite
that imports example DAGs doesn’t appear to exercise non-UTC values for `[core]
default_timezone`. Adding a regression test that imports this file with a
non-UTC timezone (e.g., Asia/Shanghai) would help prevent the OverflowError
from reappearing.
##########
airflow-core/src/airflow/example_dags/example_inlet_event_extra.py:
##########
@@ -33,7 +33,7 @@
with DAG(
dag_id="read_asset_event",
catchup=False,
- start_date=datetime.datetime.min,
+ start_date=datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc),
Review Comment:
`start_date=datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc)` is
repeated for each DAG in this module. Consider using a shared module-level
constant to reduce duplication.
--
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]