vatsrahul1001 opened a new pull request, #67092:
URL: https://github.com/apache/airflow/pull/67092

   Backport of #63871 to \`v3-2-test\` for the 3.2.2 release.
   
   Fixes [#63334](https://github.com/apache/airflow/issues/63334) / 
[#65674](https://github.com/apache/airflow/issues/65674): when a templated 
field contained a dict with callable values (e.g. \`{\"sort_key\": lambda x: 
x}\`), \`serialize_template_field\` fell through to the str() path and embedded 
the callable's memory address (\`<function ... at 0x...>\`) in the serialized 
output. That caused the DAG's serialized hash to change on every parse, 
inflating DAG versions. The fix normalizes callables to their qualname inside 
dict-handling, deterministically sorts mixed-key dicts, and routes the task 
runner template-field code through the same helper.
   
   ### Backport notes
   
   Conflicts resolved in 
\`airflow-core/tests/unit/serialization/test_helpers.py\`:
   
   - v3-2-test's \`test_helpers.py\` had only one test 
(\`test_serialize_template_field_with_very_small_max_length\`) with a local 
import. The PR adds top-level imports (\`json\`, \`pytest\`, 
\`SET_DURING_EXECUTION\`, \`NOTSET\`, \`serialize_template_field\`) and ~600 
lines of new tests. All referenced symbols exist on v3-2-test (\`NOTSET\` at 
\`serialization/definitions/notset.py\`, \`SET_DURING_EXECUTION\` at 
\`task-sdk/.../_internal/types.py\`), so PR side was taken verbatim for both 
conflict regions.
   
   Production files (\`helpers.py\`, \`task_runner.py\`) and the test files 
\`test_dag_serialization.py\`, \`test_renderedtifields.py\`, 
\`test_task_runner.py\` auto-merged cleanly. New file 
\`test_dag_decorator_version.py\` added as-is. All prek hooks (mypy, ruff, 
license) passed.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Opus 4.7 (1M context)
   
   Generated-by: Claude Opus 4.7 (1M context) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to