Skip to content

Fix TimeSensor start_from_trigger causing dag_version churn - #69610

Open
bramhanandlingala wants to merge 6 commits into
apache:mainfrom
bramhanandlingala:fix/#69543
Open

bramhanandlingala wants to merge 6 commits into
apache:mainfrom
bramhanandlingala:fix/#69543

Conversation

@bramhanandlingala

@bramhanandlingala bramhanandlingala commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

closes: #69543

TimeSensor computed its target time using datetime.now() at DAG-parse
time. When start_from_trigger=True, this value got baked into the
serialized DAG, causing the dag_version to change on every parse that
crossed a day boundary.

This can't be fixed by computing the value differently, since the target
moment is inherently different each day but start_trigger_args is only
computed once per DAG version. So start_from_trigger=True now raises a
ValueError instead of silently producing a broken serialization.
deferrable=True still works as before and is unaffected.

Also fixed the docs, which incorrectly said the target time is evaluated
against data_interval_end/run_after — it never was.

Added a test for the new ValueError; all existing tests still pass.

Gen-AI disclosure: I used a generative AI tool to help identify the root
cause, write tests, and draft the PR description. I reviewed, tested, and
verified all changes locally before submitting.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude

Generated-by: Claude following the guidelines

@bramhanandlingala

Copy link
Copy Markdown
Contributor Author

Hi @bugraoz93, @choo121600, @ephraimbuddy, @henry3260, @jason810496, @rawwar @kaxil @Lee-W
Request You All, please review and Merge as need for this fix

@shahar1 shahar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vamsi-klu

This comment was marked as spam.

kaxil added a commit to astronomer/airflow that referenced this pull request Sep 18, 2026
DayOfWeekSensor's xref in the standard provider's sensor guide pointed at
the pre-provider-split airflow.sensors.weekday path, which no longer
exists; the class now lives under airflow.providers.standard.sensors.weekday.

BaseXCom's xref in the common.io XCom backend guide pointed at
airflow.models.xcom.BaseXCom, which is a deprecated compat shim; the real
class lives at airflow.sdk.bases.xcom.BaseXCom.

The TimeSensor xref in the same sensor guide is also broken (points at a
non-existent sensors.time_sensor module) but is left alone here since apache#69610,
apache#69746, and apache#69925 are all open against that same paragraph.
kaxil added a commit to astronomer/airflow that referenced this pull request Sep 18, 2026
DayOfWeekSensor's xref in the standard provider's sensor guide pointed at
the pre-provider-split airflow.sensors.weekday path, which no longer
exists; the class now lives under airflow.providers.standard.sensors.weekday.

BaseXCom's xref in the common.io XCom backend guide pointed at
airflow.models.xcom.BaseXCom, a deprecated compat shim. The task-sdk docs
only expose it at the flat airflow.sdk.BaseXCom path (autoapiclass in
task-sdk/docs/api.rst, autoapi_generate_api_docs=False elsewhere), matching
the existing convention for this class of xref (e.g. airflow.sdk.ResumableJobMixin).

The TimeSensor xref in the same sensor guide is also broken (points at a
non-existent sensors.time_sensor module) but is left alone here since apache#69610,
apache#69746, and apache#69925 are all open against that same paragraph.
kaxil added a commit that referenced this pull request Sep 19, 2026
DayOfWeekSensor's xref in the standard provider's sensor guide pointed at
the pre-provider-split airflow.sensors.weekday path, which no longer
exists; the class now lives under airflow.providers.standard.sensors.weekday.

BaseXCom's xref in the common.io XCom backend guide pointed at
airflow.models.xcom.BaseXCom, a deprecated compat shim. The task-sdk docs
only expose it at the flat airflow.sdk.BaseXCom path (autoapiclass in
task-sdk/docs/api.rst, autoapi_generate_api_docs=False elsewhere), matching
the existing convention for this class of xref (e.g. airflow.sdk.ResumableJobMixin).

The TimeSensor xref in the same sensor guide is also broken (points at a
non-existent sensors.time_sensor module) but is left alone here since #69610,
#69746, and #69925 are all open against that same paragraph.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dag_version inflection when using TimeSensor with start_from_trigger = True

4 participants