-
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
[amp-refactor][15/n] Rename AssetConditionCursor -> AssetConditionEvaluationState #19035
Conversation
f08149c
to
7c58a41
Compare
a4ccc5e
to
f7ef51e
Compare
f7ef51e
to
0bd84b0
Compare
7c58a41
to
4583f25
Compare
Deploy preview for dagit-storybook ready! ✅ Preview Built with commit 0bd84b0. |
Deploy preview for dagster-university ready! ✅ Preview Built with commit 0bd84b0. |
4583f25
to
dd4086f
Compare
0bd84b0
to
26af907
Compare
dd4086f
to
18d1b83
Compare
26af907
to
0313f70
Compare
e98b265
to
14d39a6
Compare
42b91bc
to
309325a
Compare
14d39a6
to
953dffd
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.
We settled on different names in this thread, right? https://dagsterlabs.slack.com/archives/C04UD72HHQX/p1704326165574669
309325a
to
1bb1419
Compare
674bc95
to
cb8d03b
Compare
@sryza renamed/refactored to align w/ that thread |
cb8d03b
to
7add39d
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.
A few final comments / questions, otherwise looks good to go
def equivalent_to_stored_evaluation(self, other: Optional["AssetConditionEvaluation"]) -> bool: | ||
"""Returns if all fields other than `run_ids` are equal.""" | ||
"""Returns if this evaluation is functionally equivalent to the given stored evaluation. |
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.
What are the situations where they would be considered functionality equivalent but not __equal__
? Worth mentioning at least an example here.
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.
added
evaluation: AssetConditionEvaluation | ||
extra_values_by_unique_id: Mapping[str, PackableValue] | ||
evaluation_timestamp: Optional[float] |
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 this redundant with the timestamp on evaluation
?
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.
Not exactly. The "evaluation_timestamp" is used as the explicit timestamp for the entire tick's evaluation. This is synchronized across all assets (in theory, this means that you can't get weird situations where we evaluate right at an hour boundary and so two assets with identical partitions definitions were interpreted as having a different set of partitions if one was evaluated before and the other after the hour transition).
This timestamp is used for things like cron schedule ticks as well.
In contrast, the "start_timestamp" on the root evaluation is just when we started evaluating that particular asset (so we can calculate how long that evaluation took).
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, got it. Would it make sense to call it previous_tick_evaluation_timestamp
to disambiguate?
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.
done!
|
||
condition: "AssetCondition" | ||
evaluation: AssetConditionEvaluation |
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.
Thoughts on calling this latest_evaluation
(with implications for some of the other properties)?
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.
Yeah I've been going back and forth on that point -- my feeling was that it might be redundant, as we can just call the entire object previous_evaluation_state
. If we do that, then previous_evaluation_state.previous_evaluation
is a bit weird.
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 way I am inclined to look at it is that the "state" isn't exactly the state of the previous valuation. It's more that the ongoing incremental state we track includes the previous evaluation.
E.g. imagine a world where we want to get smart about the order that we compute rules in, and, to do that, we want to track statistics on the typical amount of time it takes to evaluate conditions. To avoid overfitting on the previous tick, we might want to track the last N ticks. That data could make sense to store inside this object, but wouldn't be part of the previous evaluation.
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.
ok updated it to previous_evaluation
and previous_tick_evaluation_timestamp
. kept "max_storage_id" as is, as "previous_max_storage_id" feels like the max storage id that was used for the previous evaluation, which is one level "too deep"
7add39d
to
60e1c31
Compare
1bb1419
to
b1a03c9
Compare
60e1c31
to
d27f79a
Compare
b1a03c9
to
c068ebc
Compare
d27f79a
to
d0f2f5b
Compare
Merge activity
|
c068ebc
to
d08f558
Compare
d0f2f5b
to
4e26389
Compare
…luationState (#19035) ## Summary & Motivation After some deliberation, "cursor" seems to be a poor name for what these objects are actually tracking. Instead, we go with AssetConditionEvaluationInfo as a more general name. We do still want to distinguish this object, which is used to index/checkpoint computation, from the AssetConditionEvaluationResult object, which contains only a subset of the total information (related to what was actually calculated on that tick) This PR also removes the unnecessary AssetConditionEvaluationResult object that used to exist as an in-memory-only organizational tool, in light of the fact that we can just directly return AssetConditionEvaluationInfo objects from the body of the evaluate function. ## How I Tested These Changes
Summary & Motivation
After some deliberation, "cursor" seems to be a poor name for what these objects are actually tracking. Instead, we go with AssetConditionEvaluationInfo as a more general name.
We do still want to distinguish this object, which is used to index/checkpoint computation, from the AssetConditionEvaluationResult object, which contains only a subset of the total information (related to what was actually calculated on that tick)
This PR also removes the unnecessary AssetConditionEvaluationResult object that used to exist as an in-memory-only organizational tool, in light of the fact that we can just directly return AssetConditionEvaluationInfo objects from the body of the evaluate function.
How I Tested These Changes