Skip to content

Conversation

@gopidesupavan
Copy link
Member

Alright bit of context here:

The test validates a minmum of 7 dags serialised or not. until it was working fine, recently edge3 example_dag converted to TasSDK dag. Then the tests failing to validate max_consecutive_failed_dag_runs as TaskSDk sets to default to -1 and serialised dagbag one have default to zero.

https://github.com/apache/airflow/blob/main/task-sdk/src/airflow/sdk/definitions/dag.py#L403

https://github.com/apache/airflow/actions/runs/14621219429/job/41021936045?pr=49631#step:6:1909


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@gopidesupavan
Copy link
Member Author

created issue here #49648.


if field == "max_consecutive_failed_dag_runs":
# TaskSDK sets -1 default to max_consecutive_failed_dag_runs
assert actual in [expected, 0], f"{dag.dag_id}.{field} does not match"
Copy link
Member

Choose a reason for hiding this comment

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

@ashb @amoghrajesh @kaxil -> just checking if that was intentional change to change it it to -1 ? max_consecutive_runs is experimental so should not matter, just checking

Copy link
Member

Choose a reason for hiding this comment

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

Merrging to unblock main without waiting

Copy link
Contributor

Choose a reason for hiding this comment

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

I really do not recall why we did this, maybe there was no good reason to do it at all.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it was -1 in the serialization side and set to default from config elsewhere? Or perhaps it was when we hadn't yet worked out what we would do for config in the task-sdk dist yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes the default value zero being set here https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/models/dag.py#L438. so should we align all with zero?

Copy link
Member

Choose a reason for hiding this comment

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

yeah

@potiuk potiuk merged commit d4b542b into apache:main Apr 23, 2025
51 checks passed
prabhusneha pushed a commit to astronomer/airflow that referenced this pull request Apr 25, 2025
@gopidesupavan gopidesupavan deleted the fix-tests-example-dags branch May 28, 2025 20:31
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.

5 participants