Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def on_task_instance_running(
assert task
dagrun = context["dag_run"]
dag = context["dag"]
start_date = context["start_date"]
start_date = task_instance.start_date
self._on_task_instance_running(task_instance, dag, dagrun, task, start_date)
else:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,6 @@ class _BasePythonVirtualenvOperator(PythonOperator, metaclass=ABCMeta):
"prev_execution_date",
"prev_execution_date_success",
}
if AIRFLOW_V_3_0_PLUS:
PENDULUM_SERIALIZABLE_CONTEXT_KEYS.add("start_date")

AIRFLOW_SERIALIZABLE_CONTEXT_KEYS = {
"macros",
Expand Down
1 change: 0 additions & 1 deletion task_sdk/src/airflow/sdk/execution_time/task_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def get_template_context(self) -> Context:
# TODO: Ensure that ti.log_url and such are available to use in context
# especially after removal of `conf` from Context.
"ti": self,
"start_date": self.start_date,
"outlet_events": OutletEventAccessors(),
# "inlet_events": InletEventsAccessors(task.inlets, session=session),
"macros": MacrosAccessor(),
Expand Down
1 change: 1 addition & 0 deletions task_sdk/src/airflow/sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class RuntimeTaskInstanceProtocol(Protocol):
map_index: int | None
max_tries: int
hostname: str | None = None
start_date: datetime

def xcom_pull(
self,
Expand Down
2 changes: 0 additions & 2 deletions task_sdk/tests/execution_time/test_task_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@ def test_get_context_without_ti_context_from_server(self, mocked_parse, make_ti_
"outlet_events": OutletEventAccessors(),
"outlets": task.outlets,
"run_id": "test_run",
"start_date": start_date,
"task": task,
"task_instance": runtime_ti,
"ti": runtime_ti,
Expand Down Expand Up @@ -869,7 +868,6 @@ def test_get_context_with_ti_context_from_server(self, create_runtime_ti, mock_s
"prev_end_date_success": timezone.datetime(2024, 12, 1, 1, 0, 0),
"prev_start_date_success": timezone.datetime(2024, 12, 1, 0, 0, 0),
"run_id": "test_run",
"start_date": timezone.datetime(2024, 12, 1, 1, 0),
"task": task,
"task_instance": runtime_ti,
"ti": runtime_ti,
Expand Down
Loading