-
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
Propagate automation condition information through the UI for user code conditions #25211
Propagate automation condition information through the UI for user code conditions #25211
Conversation
d2572a5
to
5c39c20
Compare
11b2b09
to
7a838b5
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.
@gibsondan flagging this PR as at one point we removed this data from the snapshot due to (iirc?) unfounded beliefs that it was blowing up the workspace size -- just confirming that this was actually unfounded
I think it was in fact visibly increasing the workspace size but it remains
unclear what the exact impact of that was - worth a quick chat maybe
…On Thu, Oct 10, 2024 at 7:41 PM OwenKephart ***@***.***> wrote:
***@***.**** commented on this pull request.
@gibsondan <https://github.com/gibsondan> flagging this PR as at one
point we removed this data from the snapshot due to (iirc?) unfounded
beliefs that it was blowing up the workspace size -- just confirming that
this was actually unfounded
—
Reply to this email directly, view it on GitHub
<#25211 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACAPJCZP27KISBEL745WMADZ24NE7AVCNFSM6AAAAABPX3XBTCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGNRRG4YDGNZSG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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.
is there a world where we only persist this new thing once you opt in to user-defined automation condition sensors? or does that make things way more complicated?
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.
sounds like that world is indeed possible
7a838b5
to
10e5e25
Compare
5c39c20
to
8acc87b
Compare
10e5e25
to
2734223
Compare
8acc87b
to
66d4fe6
Compare
2734223
to
404dcbf
Compare
66d4fe6
to
3a1e7c1
Compare
c02046f
to
12ccaf1
Compare
item.description, | ||
item.children, | ||
) | ||
elif isinstance(item, AutomationConditionSnapshot): | ||
label, name, description, children = ( | ||
item.node_snapshot.label, | ||
item.node_snapshot.name, | ||
item.node_snapshot.description, | ||
item.children, | ||
) |
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.
can we not just _always_ use the snapshot?
See this comment inline on Graphite.
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 we need to use the AutomationConditionEvaluation in the history UI, as we don't store the full snapshot there. We could put a method on AutomationConditionEvaluation that reconstructs an AutomationConditionSnapshot though, just seems out of scope for this PR. Can stack one a PR for that on top though
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.
Why don't we just always use the snapshots?
5c31e88
to
ddc6079
Compare
12ccaf1
to
3bd0f6e
Compare
ddc6079
to
ebe651d
Compare
700d7e4
to
b9a4a6e
Compare
In general, because we need to be able to execute the conditions on the daemon side of the process if executing in daemon mode. In the code sample you linked to, no good reason (and I removed it). |
automation_condition = ( | ||
self._asset_node_snap.automation_condition_snapshot | ||
or self._asset_node_snap.automation_condition | ||
) | ||
if automation_condition: | ||
return GrapheneAutomationCondition( | ||
# we only store one of automation_condition or automation_condition_snapshot | ||
automation_condition | ||
if isinstance(automation_condition, AutomationConditionSnapshot) | ||
else automation_condition.get_snapshot() | ||
) |
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.
Don't see why we don't unconditionally use the snapshot in the graphql server
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.
As in why can't the asset_node_snap just have the snapshot?
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.
Responded to this above
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.
This is just a weird mental model in my mind.
Seems like there should be just a snapshot but we should have special logic to reconstruct the "real" automation condition in the asset daemon from the snapshot.
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 reviewed the UI + graphql portions of this but it looks good to me! Left one inline comment, might be nice to remove the autoMaterializePolicy
fields from the graphql queries if we can.
js_modules/dagster-ui/packages/ui-core/src/assets/AssetTableFragment.tsx
Show resolved
Hide resolved
8bf74fd
to
12f4f07
Compare
@schrockn The snapshot is designed to only contain information that's relevant to displaying a condition in the UI to a user. This means that it reduces down a lot of the complexity of the parameters etc. of a given condition to being just a simple string (e.g. the In general, this means that we don't enforce any contract on how those names should be generated, and so trying to deserialize them is impossible, and much more the job of the serdes framework. So if we wanted to avoid having both an AutomationCondition field and an AutomationConditionSnapshot field on the asset_node_snap, then we'd need to go the route of only populating the AutomationCondition field, which would necessitate having a special "NonExecutableAutomationCondition" or something that we could transform user-defined conditions into, whose purpose would be to allow us to get the parts of user-defined automation conditions that are necessary to render it in the UI across the serdes boundary. I explored this approach in a previous PR but we deemed that to be a confusing system, so that approach was abandoned, but I could be convinced to go back to that setup. |
12f4f07
to
cab309b
Compare
cab309b
to
fad7f9a
Compare
fad7f9a
to
9a74d41
Compare
…de conditions (dagster-io#25211) ## Summary & Motivation It is not possible to serialize the full automation condition object if it is user-defined. In these cases, we only persist the snapshot. Updates the graphql code to use this snapshot instead of the raw condition, and adds e2e test ensuring we can execute / get the correct label for these objects. ## How I Tested These Changes ## Changelog NOCHANGELOG
Summary & Motivation
It is not possible to serialize the full automation condition object if it is user-defined. In these cases, we only persist the snapshot.
Updates the graphql code to use this snapshot instead of the raw condition, and adds e2e test ensuring we can execute / get the correct label for these objects.
How I Tested These Changes
Changelog
NOCHANGELOG