potiuk opened a new pull request, #74829:
URL: https://github.com/apache/airflow/pull/74829
`GET .../xcomEntries/{key}?deserialize=true` renders stored values with
`stringify()`, but fell back to `XComModel.deserialize_value()` for any
`airflow.*` class. That fallback runs full serde in the API server just to
turn
the result back into a string for the response. The API server only needs the
readable form, so it does not have to rebuild the objects at all. This
follows
the "full serde shouldn't run on the API server" direction from the review
of #73625, and matches the scheduler-side change in #72718.
`stringify()` now renders `airflow.*` classes from their serialized fields,
without importing them. For attrs/dataclass types like `Asset` and
`AssetAlias`, the output is the same `repr`-style text as before, e.g.
`AssetAlias(name='x', group='asset')`. Nested non-Airflow classes keep the
existing `module.Class@version=N(...)` form. Because nothing raises
`StringifyNotSupportedError` any more, the fallback is removed from the XCom
endpoint and the `XComOperatorLink` extra-link lookup.
Response shapes and the OpenAPI schema are unchanged. `deserialize=false` and
`stringify=true` behave as before. The Execution API write path is untouched.
Tests:
- `uv run pytest` for the XCom route tests (90 passed), `test_stringify.py`
(53 passed), `test_operatorlink.py` (2 passed), `test_extra_links.py`
(28 passed) and `utils/test_json.py` (11 passed)
- The new route, stringify and operator-link tests fail without the change
- `prek run --files` on the changed files: all hooks pass except
`Generate the FastAPI API spec`, which needs the Breeze CI image. The
change
does not touch any route signature or datamodel.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Opus 5 following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
---
* Read the **[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))
is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License
Policy](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).
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]