-
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
Definitions.merge #22035
Definitions.merge #22035
Conversation
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.
Great. Using the index number is a little goofy. I think it is more clear to list out the entire set of keys that you are trying to merge to give more context. Not super critical but something to consider addressing before merge.
|
||
with pytest.raises( | ||
DagsterInvariantViolationError, | ||
match="Definitions objects 0 and 1 both have a resource with key 'resource1'", |
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.
wording around "0 and 1" slightly goofy.
Slightly better might be:
"Trying to merge definitions with resources {"foo", "bar"} and {"bar", "baaz"}. {"bar"} conflicts"
or something
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.
Oops saw this and then forgot about it and then merged. Going to handle it in a followup.
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.
No problem at all. Just a recommendation.
1681396
to
ebcefd4
Compare
ebcefd4
to
bb89bd4
Compare
## Summary & Motivation There are diverse situations where it's useful to be able to pass around collections of definitions. Doing this in Dagster right now is quite awkward. Relevant situations: - Writing a factory that returns a few assets, a few checks, and a job that executes them together. - A submodule defines a few assets, a job, and a schedule. A different submodule does the same. They should all be in the same code location. - dagster-io#21387 (comment) - dagster-io/internal#8216 Unlike the [prior version of this PR](dagster-io#21746), this PR does _not_ turn `Definitions` into a "dumb" data class. I.e. it still validates that all assets and jobs can be bound, at construction time. ## How I Tested These Changes
Summary & Motivation
There are diverse situations where it's useful to be able to pass around collections of definitions. Doing this in Dagster right now is quite awkward.
Relevant situations:
Unlike the prior version of this PR, this PR does not turn
Definitions
into a "dumb" data class. I.e. it still validates that all assets and jobs can be bound, at construction time.How I Tested These Changes