AnvayKharb opened a new pull request, #56855:
URL: https://github.com/apache/airflow/pull/56855
This pull request introduces improvements and bug fixes to both the Airflow
API and UI codebases. The main focus is on enhancing the XCom API endpoint to
support retrieval of entries from prior DAG run dates, ensuring proper
serialization in update operations, and improving type safety and correctness
in UI components related to DAG tags and flexible forms.
### Airflow API improvements
* Added a new `include_prior_dates` query parameter to the `get_xcom_entry`
endpoint, allowing users to optionally retrieve XCom entries from earlier DAG
runs if not present in the specified run. This is now tested to ensure correct
behavior.
[[1]](diffhunk://#diff-fb52cdde8a46d6f5e53c3897f2df2e975ede884ab543f0cec7d6e890c71cba82R81)
[[2]](diffhunk://#diff-fb52cdde8a46d6f5e53c3897f2df2e975ede884ab543f0cec7d6e890c71cba82R90)
[[3]](diffhunk://#diff-e7d4b0a7b972dd8857d177d8d6501b8685e1c46c878f3b12067100cb4f1a1707R213-R268)
* Fixed the update logic for XCom entries to correctly serialize the new
value from the patch body, addressing a bug in the assignment.
[[1]](diffhunk://#diff-fb52cdde8a46d6f5e53c3897f2df2e975ede884ab543f0cec7d6e890c71cba82L318)
[[2]](diffhunk://#diff-fb52cdde8a46d6f5e53c3897f2df2e975ede884ab543f0cec7d6e890c71cba82L339-R339)
* Minor code cleanup in DAG run validation for XCom creation, removing a
redundant line.
### Airflow UI improvements
* Improved type safety in DAG tag filtering and infinite query logic by
explicitly casting API responses to the expected `DAGTagCollectionResponse`
type.
[[1]](diffhunk://#diff-3b1bb6c839ca6f04a53ea88d17f300ebb28bcffd3de2bc8179e4a16dc60ccd54L212-R212)
[[2]](diffhunk://#diff-c9d6e5f312b5cf3931edc8146c6236e6bf54a2279e0d72be2935ea78d60ce1c6L49-R58)
* Refined array field detection logic in the flexible form component to use
optional chaining and avoid errors when item types are undefined.
* Added `ts-morph` as a new dependency in the UI package for future
type-safe code manipulations.- Add include_prior_dates parameter to XCom API
endpoint with default True
- Enable XCom retrieval from different DAG execution dates in Web UI
- Add comprehensive test coverage for include_prior_dates functionality
- Fix TypeScript linting errors in UI components and queries
- Maintain backward compatibility for existing API consumers
Fixes issue where XCom values pushed in one DAG could not be retrieved from
another DAG if their scheduled execution dates differed.
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information.
In case of fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party
License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a
newsfragment file, named `{pr_number}.significant.rst` or
`{issue_number}.significant.rst`, in
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
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]