-
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
[DS][30/n] Create new unique ids for each child based off of index #21671
[DS][30/n] Create new unique ids for each child based off of index #21671
Conversation
9aebb7f
to
ced1666
Compare
51c95bf
to
287734c
Compare
ced1666
to
cb53c68
Compare
287734c
to
fb609ea
Compare
@@ -73,7 +73,7 @@ def create( | |||
return SchedulingContext.model_construct( | |||
candidate_slice=asset_graph_view.get_asset_slice(asset_key), | |||
condition=scheduling_condition, | |||
condition_unique_id=scheduling_condition.get_unique_id(None), | |||
condition_unique_id=scheduling_condition.get_unique_id(None, None), |
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.
same nit
@@ -25,9 +25,9 @@ def description(self) -> str: | |||
def evaluate(self, context: SchedulingContext) -> SchedulingResult: |
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.
Question: does the `Sequence` type in Python guarantee stable ordering? We might want to consider typing this as `List` which for sure guarantees that. We're relying on index for identity so just want to be sure.
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.
From what I can tell, the answer is yes -- I think in general if an object supports index operations (which all Sequences do), then ordering must be stable.
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.
question about ordering guarantees
b39eb21
to
aa9b7f1
Compare
b835cb7
to
8158240
Compare
aa9b7f1
to
393055f
Compare
8158240
to
3c56fea
Compare
393055f
to
0da2923
Compare
3c56fea
to
be7aa64
Compare
0da2923
to
0d2ac17
Compare
be7aa64
to
b721c23
Compare
0d2ac17
to
96789db
Compare
b721c23
to
f64a604
Compare
96789db
to
bc62b76
Compare
f64a604
to
5033665
Compare
bc62b76
to
e5a2f0d
Compare
5033665
to
d09af0c
Compare
Merge activity
|
7ec169c
to
2013a99
Compare
d09af0c
to
80939db
Compare
…agster-io#21671) ## Summary & Motivation This fixes an issue I noticed when experimenting with the PR above this (creating the eager condition). If we base an evaluation node's id off of purely its description and its parent id, then we run into an issue if you have two children with the same description (but different sub-conditions). This new scheme ensures that all nodes in the graph will have unique ids, as no two nodes can have the same parent id, description, AND index within that parent ## How I Tested These Changes
Summary & Motivation
This fixes an issue I noticed when experimenting with the PR above this (creating the eager condition).
If we base an evaluation node's id off of purely its description and its parent id, then we run into an issue if you have two children with the same description (but different sub-conditions).
This new scheme ensures that all nodes in the graph will have unique ids, as no two nodes can have the same parent id, description, AND index within that parent
How I Tested These Changes