Kashi7-dev opened a new pull request, #77481: URL: https://github.com/apache/airflow/pull/77481
Make dictionary key sorting configurable in the Rendered Templates view. Add `[core] rendered_template_fields_sort_keys`, defaulting to `True` to preserve existing behavior. Setting it to `False` preserves dictionary insertion order recursively when preparing rendered fields in Core and the Task SDK, including dotted renderer paths. Dag serialization retains its existing sorting behavior. Include configuration documentation and regression tests. closes: #27026 ### Validation - Core serialization helper and rendered-field tests: **91 passed**. - Task runner tests: **608 passed, 8 failed**. The same eight `TestTriggerDagRunOperator` tests also fail on the unchanged baseline in the local environment. - Task SDK mypy passed. Core mypy reports a `TaskGroup` import error in `dag_edges.py:25`, also reproduced on the unchanged baseline. Only this hook was skipped for the local commit and push. - Core documentation build passed after a local CI-image dependency workaround for Chromium. No dependency or image changes are included in this PR. - Manual DAG runs confirmed alphabetical ordering with `True` and insertion ordering with `False`, including nested dictionaries. ### Screenshots **Before — default alphabetical ordering (`True`):** <!-- Attach the screenshot showing a_second, m_nested, z_first. --> <img width="691" height="441" alt="image" src="https://github.com/user-attachments/assets/87c4ba52-841c-47f1-a1f6-f208caa45286" /> **After — insertion ordering (`False`):** <!-- Attach the screenshot showing z_first, a_second, m_nested. --> ![Uploading image.png…]() --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — ChatGPT / OpenAI Codex Generated-by: ChatGPT / OpenAI Codex following [[the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) AI assistance was used for investigation, implementation guidance, test design, and documentation. I reviewed the changes and ran the validation described above. --- * Read the **[[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged. * For fundamental code changes, an Airflow Improvement Proposal ([[AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed. * When adding dependency, check compliance with the [[ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x)](https://www.apache.org/legal/resolved.html#category-x). * For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments)](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number. -- 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]
