Skip to content

Conversation

@kaxil
Copy link
Member

@kaxil kaxil commented Oct 16, 2025

Task execution and scheduler operations failed when processing dag runs with NULL conf values in the database. This occurred during Airflow 2.x to 3.x upgrades where existing running DAG runs had NULL conf, and when clearing dag runs that were migrated with NULL conf during offline migrations.

The execution API DagRun datamodel required conf to be a dict, but the database schema allows NULL. This fix makes the conf field nullable to match the database schema, Core API datamodel, and Task SDK expectations.

For backward compatibility, older API versions (pre-2025-10-10) will receive an empty dict instead of None when conf is NULL.

Fixes #56707
Fixes #56705


^ 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.

Task execution and scheduler operations failed when processing dag runs
with NULL conf values in the database. This occurred during Airflow 2.x
to 3.x upgrades where existing running DAG runs had NULL conf, and when
clearing dag runs that were migrated with NULL conf during offline migrations.

The execution API DagRun datamodel required conf to be a dict, but the
database schema allows NULL. This fix makes the conf field nullable to
match the database schema, Core API datamodel, and Task SDK expectations.

For backward compatibility, older API versions (pre-2025-10-10) will
receive an empty dict instead of None when conf is NULL.

Fixes apache#56707
Fixes apache#56705
@kaxil kaxil added this to the Airflow 3.1.1 milestone Oct 16, 2025
@kaxil kaxil added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Oct 16, 2025
@kaxil kaxil requested a review from tirkarthi October 16, 2025 15:41
@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Oct 16, 2025
@ephraimbuddy
Copy link
Contributor

@kaxil
Copy link
Member Author

kaxil commented Oct 16, 2025

What do you think about my approach here: https://github.com/apache/airflow/pull/55884/files#diff-680cf6d70e96761db3869142642ba1df32e5c2c5c8d1b9ab65d0200dca4718daR229

Oh I hadn't seen that PR. The generated Task SDK client already accepts None & DB accepts null values -- so it just made sense to make it consistent -- than to have to coerce it everywhere null is passed:

conf: Annotated[dict[str, Any] | None, Field(title="Conf")] = None

@tirkarthi
Copy link
Contributor

IMO, it will be good to have the db and models in sync. Similar report with our migration #50386 .

@kaxil
Copy link
Member Author

kaxil commented Oct 16, 2025

Yeah, this PR makes it consistent. Could I get a review @tirkarthi

@kaxil
Copy link
Member Author

kaxil commented Oct 16, 2025

(k8s failure fixed in #56733)

@kaxil kaxil requested a review from gopidesupavan October 16, 2025 17:33
Copy link
Member

@gopidesupavan gopidesupavan left a comment

Choose a reason for hiding this comment

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

LGTM :)

@kaxil kaxil merged commit 0815019 into apache:main Oct 16, 2025
109 of 112 checks passed
@kaxil kaxil deleted the dagrun-conf-null branch October 16, 2025 17:56
@github-actions
Copy link

Backport failed to create: v3-1-test. View the failure log Run details

Status Branch Result
v3-1-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 0815019 v3-1-test

This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

@tirkarthi
Copy link
Contributor

Thanks @kaxil

abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
…#56729)

Task execution and scheduler operations failed when processing dag runs
with NULL conf values in the database. This occurred during Airflow 2.x
to 3.x upgrades where existing running DAG runs had NULL conf, and when
clearing dag runs that were migrated with NULL conf during offline migrations.

The execution API DagRun datamodel required conf to be a dict, but the
database schema allows NULL. This fix makes the conf field nullable to
match the database schema, Core API datamodel, and Task SDK expectations.

For backward compatibility, older API versions (pre-2025-10-10) will
receive an empty dict instead of None when conf is NULL.

Fixes apache#56707
Fixes apache#56705
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
…#56729)

Task execution and scheduler operations failed when processing dag runs
with NULL conf values in the database. This occurred during Airflow 2.x
to 3.x upgrades where existing running DAG runs had NULL conf, and when
clearing dag runs that were migrated with NULL conf during offline migrations.

The execution API DagRun datamodel required conf to be a dict, but the
database schema allows NULL. This fix makes the conf field nullable to
match the database schema, Core API datamodel, and Task SDK expectations.

For backward compatibility, older API versions (pre-2025-10-10) will
receive an empty dict instead of None when conf is NULL.

Fixes apache#56707
Fixes apache#56705
kaxil added a commit that referenced this pull request Oct 21, 2025
Task execution and scheduler operations failed when processing dag runs
with NULL conf values in the database. This occurred during Airflow 2.x
to 3.x upgrades where existing running DAG runs had NULL conf, and when
clearing dag runs that were migrated with NULL conf during offline migrations.

The execution API DagRun datamodel required conf to be a dict, but the
database schema allows NULL. This fix makes the conf field nullable to
match the database schema, Core API datamodel, and Task SDK expectations.

For backward compatibility, older API versions (pre-2025-10-10) will
receive an empty dict instead of None when conf is NULL.

Fixes #56707
Fixes #56705

(cherry picked from commit 0815019)
TyrellHaywood pushed a commit to TyrellHaywood/airflow that referenced this pull request Oct 22, 2025
…#56729)

Task execution and scheduler operations failed when processing dag runs
with NULL conf values in the database. This occurred during Airflow 2.x
to 3.x upgrades where existing running DAG runs had NULL conf, and when
clearing dag runs that were migrated with NULL conf during offline migrations.

The execution API DagRun datamodel required conf to be a dict, but the
database schema allows NULL. This fix makes the conf field nullable to
match the database schema, Core API datamodel, and Task SDK expectations.

For backward compatibility, older API versions (pre-2025-10-10) will
receive an empty dict instead of None when conf is NULL.

Fixes apache#56707
Fixes apache#56705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

4 participants