New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add XCom tab to Grid #35719
Add XCom tab to Grid #35719
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
tryNumber: tryNumber || 1, | ||
}); | ||
|
||
let content = <Text fontFamily="monospace">{xcom?.value}</Text>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you test this with an extremely large json text blob?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested with 49344 bytes of lorem ipsum generated from https://www.lipsum.com/ and it seems to render out fine. Do you think this is a reasonable test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good but do you mind putting in a check to see if the value is valid json and then we can format it accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I am afraid I am not following. In my test, I just have a task which returns this dict {"long_string": "Lorem..."}
. This results in two XCom entries:
- The key
long_string
:Lorem...
- And the full
return_value
:{"long_string": "Lorem..."}
Do you mean check that the entry value is a valid JSON and format that? I personally haven't have a use-case that I return an entry that is a JSON but instead if the task returns a dict then I can access the attributes as keys (if that makes sense)
(Apologies for the handwriting 😄) Here is an example of shorter XCom but with many keys to illustrate my point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the table showing key and value as separate columns. I meant to say that we could try to check if the value follows any forma and then render it accordingly. It's an additional nice-to-have. We can do it in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I get you. Would be a nice addition for sure
Thanks so much for doing it. I just have a few comments, but overall looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really love the UI changes gradually migrating from legacy to new.
When I tested locally I saw still the old link pointing to the old XCom page in the second row of Task details in Grid. As below.
Can you remove this and redirect the route from /xcom
to the grid sub-page as well?
As release 2.8.0 is just about to be cut, if finished it might still be elegible into the next version, would be cool.
258c47f
to
4ed45d0
Compare
We can keep the old xcom page for now. I think we can have separate PRs to update the grid task instance details to match the legacy page and then add a rendered template tab. Once we have those we can just delete that entire set of pages. |
74c3deb
to
fec1bae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested locally. It looks great!
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Thank you for approving and merging. It is my first PR so I am very grateful for the comments and the warm reception. Was a blast working on the PR, can't wait for it to be in the next release! |
* Add XCom tab to Grid * Combine showLogs and showXcom logic evaluation to isIndividualTaskInstance * Remove link to /xcom page from UI grid view * Use consistent naming to distinguish XcomCollection and XcomEntry * Refactor boolean vars (cherry picked from commit 77c0103)
Closes: #26905
Overview
Added XCom tab on Grid view which uses the XCom endpoints from REST API.
Tasks with no XCom
Dynamic task mapping
Implementation notes
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
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 newsfragments.