Skip to content
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

Merged
merged 1 commit into from
May 14, 2024

Conversation

OwenKephart
Copy link
Contributor

@OwenKephart OwenKephart commented May 6, 2024

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

Copy link
Contributor Author

OwenKephart commented May 6, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @OwenKephart and the rest of your teammates on Graphite Graphite

@OwenKephart OwenKephart changed the title [DS][x/n] Static constructor for eager condition [DS][32/n] Static constructor for eager condition May 6, 2024
@OwenKephart OwenKephart force-pushed the 05-06-Mark_SchedulingCondition_as_experimental branch from 9aebb7f to ced1666 Compare May 6, 2024 23:45
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from 51c95bf to 287734c Compare May 6, 2024 23:45
@OwenKephart OwenKephart force-pushed the 05-06-Mark_SchedulingCondition_as_experimental branch from ced1666 to cb53c68 Compare May 7, 2024 21:33
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from 287734c to fb609ea Compare May 7, 2024 21:33
@@ -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),
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Re: line 15]

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.

Copy link
Contributor Author

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.

Copy link
Member

@schrockn schrockn left a 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

@OwenKephart OwenKephart force-pushed the 05-03-Create_UpdatedSinceChildCondition branch from b39eb21 to aa9b7f1 Compare May 9, 2024 22:48
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from b835cb7 to 8158240 Compare May 9, 2024 22:48
@OwenKephart OwenKephart force-pushed the 05-03-Create_UpdatedSinceChildCondition branch from aa9b7f1 to 393055f Compare May 10, 2024 22:44
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from 8158240 to 3c56fea Compare May 10, 2024 22:44
@OwenKephart OwenKephart requested a review from schrockn May 10, 2024 22:47
@OwenKephart OwenKephart force-pushed the 05-03-Create_UpdatedSinceChildCondition branch from 393055f to 0da2923 Compare May 13, 2024 17:29
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from 3c56fea to be7aa64 Compare May 13, 2024 17:30
@OwenKephart OwenKephart force-pushed the 05-03-Create_UpdatedSinceChildCondition branch from 0da2923 to 0d2ac17 Compare May 13, 2024 17:51
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from be7aa64 to b721c23 Compare May 13, 2024 17:51
@OwenKephart OwenKephart force-pushed the 05-03-Create_UpdatedSinceChildCondition branch from 0d2ac17 to 96789db Compare May 14, 2024 13:47
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from b721c23 to f64a604 Compare May 14, 2024 13:47
@OwenKephart OwenKephart force-pushed the 05-03-Create_UpdatedSinceChildCondition branch from 96789db to bc62b76 Compare May 14, 2024 13:55
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from f64a604 to 5033665 Compare May 14, 2024 13:55
@OwenKephart OwenKephart force-pushed the 05-03-Create_UpdatedSinceChildCondition branch from bc62b76 to e5a2f0d Compare May 14, 2024 13:59
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from 5033665 to d09af0c Compare May 14, 2024 13:59
Copy link
Contributor Author

OwenKephart commented May 14, 2024

Merge activity

  • May 14, 10:38 AM EDT: @OwenKephart started a stack merge that includes this pull request via Graphite.
  • May 14, 10:51 AM EDT: Graphite rebased this pull request as part of a merge.
  • May 14, 10:52 AM EDT: @OwenKephart merged this pull request with Graphite.

@OwenKephart OwenKephart force-pushed the 05-03-Create_UpdatedSinceChildCondition branch 2 times, most recently from 7ec169c to 2013a99 Compare May 14, 2024 14:49
Base automatically changed from 05-03-Create_UpdatedSinceChildCondition to master May 14, 2024 14:50
@OwenKephart OwenKephart force-pushed the 05-06-Static_constructor_for_eager_condition branch from d09af0c to 80939db Compare May 14, 2024 14:51
@OwenKephart OwenKephart merged commit 960c19e into master May 14, 2024
1 check was pending
@OwenKephart OwenKephart deleted the 05-06-Static_constructor_for_eager_condition branch May 14, 2024 14:52
danielgafni pushed a commit to danielgafni/dagster that referenced this pull request Jun 18, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants