Fix DAG version inflation caused by unstable DagParam repr#65705
Open
wjddn279 wants to merge 2 commits into
Open
Fix DAG version inflation caused by unstable DagParam repr#65705wjddn279 wants to merge 2 commits into
wjddn279 wants to merge 2 commits into
Conversation
kaxil
reviewed
Apr 23, 2026
de5a57f to
a5906e3
Compare
Contributor
Author
ephraimbuddy
requested changes
Apr 30, 2026
Contributor
ephraimbuddy
left a comment
There was a problem hiding this comment.
Thanks for the fix. This is fixing similar issue as #63871.
Neither alone covers the union (e.g. dict-of-list-of-callable, list-of-dict-of-callable). I'd suggest combining them into a single PR with one recursive normalizer that walks lists, tuples, and dicts uniformly and converts callables (and objects with .serialize()) at any depth. Roughly:
def _normalize(obj):
if isinstance(obj, dict):
return {k: _normalize(v) for k, v in sorted(obj.items(), key=lambda kv: (type(kv[0]).__name__, repr(kv[0])))}
if isinstance(obj, (list, tuple)):
return [_normalize(item) for item in obj]
try:
return obj.serialize()
except AttributeError:
pass
if callable(obj):
return f"<callable {qualname(obj, True)}>"
return objOne pass, one helper, both bugs fixed. Also avoids the sorted() mixed-key crash I flagged on #63871.
Contributor
Author
|
Ok, I'll apply the changes to this PR #63871 at once. I'll mention you again once it's done. |
1 task
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.
Closes: #65674
In
serailized_dag,op_argsof task_idtransform.to_expis changed in every parsing, becauseDagParamhas no stringfy functionThe
template_fieldends up as a tuple, but since it contains an object type,is_jsonablereturns False. Because tuple has no serialize path, execution falls into this logic, and the plain string conversion embeds the raw object representation (including its id), which is highly likely to cause Dag inflation.I means the logic needs to be modified to handle the case not
is_jsonablebut list, tuple, dict type like this #63871Was generative AI tooling used to co-author this PR?
{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.