Skip to content

Commit

Permalink
Add newsfragment and fix compat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sunank200 committed Nov 12, 2024
1 parent 333a559 commit 04134f0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions newsfragments/43902.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Renamed ``execution_date`` to ``logical_date`` across the codebase to align with Airflow 3.0.

The shift towards ``logical_date`` helps move away from the limitations of ``execution_date``, particularly with dynamic DAG runs and cases where multiple runs occur at the same time. This change impacts database models, templates, and functions:
- Renamed columns and function references to ``logical_date``.
- Removed unique constraints on ``execution_date`` to support concurrent DAG runs with the same logical date.
11 changes: 8 additions & 3 deletions providers/src/airflow/providers/google/cloud/sensors/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,14 @@ def ts_function(context):
except KeyError:
from airflow.utils import timezone

data_interval = context["dag"].infer_automated_data_interval(
timezone.coerce_datetime(context["logical_date"])
)
if AIRFLOW_V_3_0_PLUS:
data_interval = context["dag"].infer_automated_data_interval(
timezone.coerce_datetime(context["logical_date"])
)
else:
data_interval = context["dag"].infer_automated_data_interval(
timezone.coerce_datetime(context["execution_date"])
)
next_info = context["dag"].next_dagrun_info(data_interval, restricted=False)
if next_info is None:
return None
Expand Down
2 changes: 1 addition & 1 deletion providers/tests/standard/operators/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ def test_virtualenv_serializable_context_fields(self, create_task_instance):
*intentionally_excluded_context_keys,
}
if not AIRFLOW_V_3_0_PLUS:
declared_keys.add(
declared_keys.update(
"next_ds",
"next_ds_nodash",
"prev_ds",
Expand Down

0 comments on commit 04134f0

Please sign in to comment.