Repository navigation
Reject reserved serialization keys in Dag run conf - #74834
Merged
Merged
Conversation
potiuk
requested review from
XD-DENG,
ashb,
bugraoz93,
choo121600,
henry3260,
jason810496,
rawwar and
shubhamraj-git
as code owners
October 15, 2026 23:38
XCom values and Human-in-the-loop params already reject keys reserved by the serialization format. Apply the same check to Dag run conf where it enters through the REST API (trigger, asset materialize, backfill) and the Execution API trigger route. A triggerer Deadline callback whose context still holds reserved keys in either encoding is marked failed instead of queued, so the scheduler loop keeps handling other deadlines. Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
potiuk
force-pushed
the
dag-run-conf-reserved-keys
branch
from
October 15, 2026 23:56
0e34951 to
4a17cf0
Compare
Member
Author
|
@pierrejeambrun @ferruzzi Could you take a look at this when you have a moment? It's targeted at 3.4.0 and needs a review to make the cut on 2026-10-19. CI is green. |
vatsrahul1001
approved these changes
Oct 18, 2026
vatsrahul1001
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. The check is applied at all four entry points, string values are left alone, and the Deadline callback guard fails the callback instead of aborting the scheduler loop.
Contributor
|
Could use reviews from @pierrejeambrun @ferruzzi before merging. |
The backfill and Execution API datamodels import it too, so keeping it in dag_run.py made two unrelated models depend on the Dag run module for a shared validation helper. Generated-by: Claude Opus 5
Contributor
Backport successfully created: v3-4-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
potiuk
added a commit
that referenced
this pull request
Oct 19, 2026
… (#75105) * Reject reserved serialization keys in Dag run conf XCom values and Human-in-the-loop params already reject keys reserved by the serialization format. Apply the same check to Dag run conf where it enters through the REST API (trigger, asset materialize, backfill) and the Execution API trigger route. A triggerer Deadline callback whose context still holds reserved keys in either encoding is marked failed instead of queued, so the scheduler loop keeps handling other deadlines. Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions * Move the conf reserved-key check next to find_reserved_keys The backfill and Execution API datamodels import it too, so keeping it in dag_run.py made two unrelated models depend on the Dag run module for a shared validation helper. (cherry picked from commit 325360c) Generated-by: Claude Opus 5 Co-authored-by: Jarek Potiuk <[email protected]>
vatsrahul1001
pushed a commit
that referenced
this pull request
Oct 20, 2026
… (#75105) * Reject reserved serialization keys in Dag run conf XCom values and Human-in-the-loop params already reject keys reserved by the serialization format. Apply the same check to Dag run conf where it enters through the REST API (trigger, asset materialize, backfill) and the Execution API trigger route. A triggerer Deadline callback whose context still holds reserved keys in either encoding is marked failed instead of queued, so the scheduler loop keeps handling other deadlines. Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions * Move the conf reserved-key check next to find_reserved_keys The backfill and Execution API datamodels import it too, so keeping it in dag_run.py made two unrelated models depend on the Dag run module for a shared validation helper. (cherry picked from commit 325360c) Generated-by: Claude Opus 5 Co-authored-by: Jarek Potiuk <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XCom values and Human-in-the-loop
params_inputalready reject keys reserved by theserialization format (
__classname__,__version__,__data__,__cache__, and thelegacy
__type,__source,__var). Dag runconfdid not, although it is passed on tocode that serializes and decodes it, for example the context of a Deadline Alert callback.
A conf value that happens to look like serialized data should reach that code as the dict
that was submitted, or be rejected up front.
This applies the same check to conf where it enters:
POST /dags/{dag_id}/dagRuns(TriggerDAGRunPostBody), also used by the UI trigger formPOST /assets/{asset_id}/materialize(MaterializeAssetBodyinherits the validator)POST /backfillsandPOST /backfills/dry_run(dag_run_conf)POST /execution/dag-runs/{dag_id}/{run_id}(TriggerDAGRunPayload, used byTriggerDagRunOperator)Nested mappings and lists are checked, and such a payload gets a 422 naming the path of the
offending mapping. String values are left as they are: unlike XCom, nothing parses a string
conf value back into a container.
For conf that is already stored,
Deadline.handle_missno longer queues a triggerer callbackwhose context holds reserved keys. It logs an error, marks the callback failed and the
deadline as missed, so the scheduler carries on with other deadlines and does not pick this
one up again.
Tests cover each entry point, ordinary conf and JSON-string values still being accepted, the
Deadline callback being failed without creating a trigger, and a scheduler run that handles
other deadlines and does not pick the failed one up again.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 5 following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.