-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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 support for XCom page in browse and task instance tab #44869
base: main
Are you sure you want to change the base?
Conversation
Not sure why my pre-commit run and the one in CI are different. |
In the legacy UI in 2.10 I invested a bit of efforts making XCom better readable for users in #40640 . Especially for Dicts and lists. Can you re-apply such feature also for the new XCom display, such that dicts are not just dumped as text? (I know I generated a set of side-effects as bugs which needed to be fixed, so in the new UI we have the chance to make it "right the first time" also with a re-usable component for DAG Run Conf. |
Thanks @jscheffl, it needs porting |
Fair. As long as it is not forgotten :-D And does not need to be e exactly the same component as in legacy if there are better components nowadays. Regarding (3) in your list above: In the past "Rest API" call the public XCom endpoint was used and for adding the "ReactJSON" I needed to add the "stringify" option as workarouns as the stringified version before used Python-style quotes which were not JSON parsable in the React / Javascript code. In the legacy this is really bad (in my view) and it would be better if in the new UI it is made "right" from the beginning. I wanted to prevent this in the past not having a breaking change in the REST API - but now would be the time with FastAPI anyway. So |
Thanks @jscheffl, here is one rough attempt I can think of. Pass |
Yeah, but this is only rough :-) Then rather to it "right" in a follow-up 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.
I agree with moving this to a more global component like we did for events.
Also +1 on trying to use syntax highlighter. I wonder if we should update xcom entry to tell us what type the value is so the UI isn't guessing
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.
Clipboard.tsx
Let's make sure this is capitalized and exported from the index.ts
file
We can leave the warning for now. I am happy to fix that later. I might just port all of the chakra generated snippets to a separate directory so we don't have to do all of this manual formatting every single time.
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.
Thanks, moved it to Clipboard.tsx
and imported it in index.ts
.
|
||
import { XComEntry } from "./XComEntry"; | ||
|
||
const XComColumn = (): Array<ColumnDef<XComResponse>> => [ |
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.
const XComColumn = (): Array<ColumnDef<XComResponse>> => [ | |
const columns = Array<ColumnDef<XComResponse>> = [ |
- start the variable names lowercase
- We're not passing any arguments, its better as just an array
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.
Thanks, done. Somehow keep forgetting to start variables with lowercase if not a type.
enableSorting: false, | ||
header: "Value", | ||
meta: { | ||
skeletonWidth: 10, |
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.
Maybe we should make the skeleton the same size of the XComEntry skeleton?
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.
The default value is width={200}
in the datatable component . Maybe I can remove the skeletonWidth
here and make width={200}
in XComEntry
?
width={colDef.meta?.skeletonWidth ?? 200} |
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.
oh yeah let's just let it render the default then
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.
Thanks, removed skeletonWidth
to render default values and it can be adjusted in future if needed.
Add support to display XCom details for a task instance in a tab. Add a clipboard button next to the value so that user can copy the value easily. The PR also adds global XCom page under browse similar to Events page currently.
Notes for review and self :
src/pages/Events/
should I move this also tosrc/pages/XCom
from currentairflow/ui/src/pages/TaskInstance/XCom
. I started with task instance and later realized it's easier to make this page global .run_id
to the response for better filtering in retrieving value API in the global XCom page without any run id in the URL params.stringify: true
to get the value. I have added askeleton
but is it possible to set some value to reuse theSkeleton
from Table's component.Related #44667
XCom under browse page