-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[ui] Code location: Graphs page #23738
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @hellendag and the rest of your teammates on Graphite |
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit c227f53. |
}), | ||
}, | ||
delay: 2000, | ||
maxUsageCount: 100, |
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.
TIL
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.
Yep, me too. It turns out that otherwise, when you click back and forth between the sections in the storybook example, it repeats the query but fails because it hasn't been mocked more than once! 😆
const queryResult = useQuery<WorkspaceGraphsQuery, WorkspaceGraphsQueryVariables>( | ||
WORSKPACE_GRAPHS_QUERY, | ||
{variables: {selector}}, | ||
); |
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.
Does the WorkspaceContext have this same data? I believe it does, in which case we should just pull this data from there using useRepository()
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 is only rely on the WorkspaceContext for this data, which should update itself automatically if the code location changes)
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.
If not, then I think we should add the extra fields to the WorkspaceContext (though we should make sure they're not super expensive / rely on non-definition level data). cc @alangenfeld
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.
It doesn't look like we query for usedSolids
for the workspace queries. I'm also not sure we should add that to the workspace query, since this is will be a fairly low-traffic page and I don't think we need the usedSolids
data elsewhere in the app. This page will be (fairly buried) under Deployment > Code location > Graphs
, and serves mostly as a browsing tool.
js_modules/dagster-ui/packages/ui-core/src/code-location/CodeLocationOpsView.tsx
Outdated
Show resolved
Hide resolved
6aba186
to
a1d22c7
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.
Still think this should be fetched as part of the WorkspaceContext (maybe lazily, and cached there)
I don't really have a strong opinion on it. No objection though, as long as it's cheap. (I don't know if it's cheap.) |
The heavy work is pulling the workspace snapshot which this query has to do just to retrieve a tiny sliver of information. The general strategy we've been trying to use is to fetch all of the workspace snapshot definition level data up front and cache it for the whole app. In this case though I do think its true this is rarely used... so I think fetching it lazily would be a better call (use the cache if its available and up to date (if its available then its up to date, otherwise a new snapshot would have overwritten it), otherwise fetch it and put it in the cache). |
a1d22c7
to
f5f965a
Compare
f5f965a
to
2d05a6f
Compare
Merge activity
|
2d05a6f
to
c227f53
Compare
Summary & Motivation
Add a Graphs section to the new Code Locations definitions page.
How I Tested These Changes
Storybook example.