-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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][31/n] Create static constructor for eager condition #21737
[DS][31/n] Create static constructor for eager condition #21737
Conversation
python_modules/dagster/dagster/_core/definitions/declarative_scheduling/scheduling_condition.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/definitions/declarative_scheduling/scheduling_condition.py
Show resolved
Hide resolved
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.
Super exciting to see this. Just want to make sure I understand 100% our default policy here and have it in the docblock
b835cb7
to
8158240
Compare
fa586bf
to
7216287
Compare
8158240
to
3c56fea
Compare
7216287
to
43d01d9
Compare
3c56fea
to
be7aa64
Compare
43d01d9
to
0d2a7ad
Compare
be7aa64
to
b721c23
Compare
0d2a7ad
to
12677c0
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.
Please add test that ensures this actually constructs.
All I am looking for is
assert isinstance(SchedulingCondition.eager(), SchedulingCondition)
b721c23
to
f64a604
Compare
12677c0
to
f4fe85b
Compare
f64a604
to
5033665
Compare
f4fe85b
to
f854324
Compare
5033665
to
d09af0c
Compare
f854324
to
26e5013
Compare
a test gets added upstack, which also tests the behavior of the composite condition |
Merge activity
|
d09af0c
to
80939db
Compare
26e5013
to
3353519
Compare
…21737) ## Summary & Motivation This creates a static constructor for an analog to the current-day eager condition. It is not identical, as it does not consider historical time partitions. It also manages state differently. In the current world, the "parent_newer" analog actually encodes a lot of different information. From its perspective, an asset partition is True if: A parent has been materialized more recently than the asset, and the run that materialized it does not target this asset, AND this asset hasn't been requested for materialization by AMP since that run came in This is a pretty confusing thing to wrap your head around, but it does have two good qualities: it avoids repeatedly requesting the downstream asset for materialization while the asset computes (techincally, the parent will remain newer than the child until the child successfully materializes, which may in practice span a large number of scheduling evaluations) it avoids repeatedly materializing the asset in the case that the requested materialization failed (similar to the above issue) This policy handles issue (1) by explicitly avoiding materializing this asset if a run is currently in progress, but does not handle case (2). This will need to be handled with a recently_requested condition, which can keep track of the asset partitions which have been requested within some timedelta. ## How I Tested These Changes
Summary & Motivation
This creates a static constructor for an analog to the current-day eager condition. It is not identical, as it does not consider historical time partitions. It also manages state differently.
In the current world, the "parent_newer" analog actually encodes a lot of different information. From its perspective, an asset partition is True if:
A parent has been materialized more recently than the asset, and the run that materialized it does not target this asset,
AND this asset hasn't been requested for materialization by AMP since that run came in
This is a pretty confusing thing to wrap your head around, but it does have two good qualities:
it avoids repeatedly requesting the downstream asset for materialization while the asset computes (techincally, the parent will remain newer than the child until the child successfully materializes, which may in practice span a large number of scheduling evaluations)
it avoids repeatedly materializing the asset in the case that the requested materialization failed (similar to the above issue)
This policy handles issue (1) by explicitly avoiding materializing this asset if a run is currently in progress, but does not handle case (2).
This will need to be handled with a recently_requested condition, which can keep track of the asset partitions which have been requested within some timedelta.
How I Tested These Changes