-
Notifications
You must be signed in to change notification settings - Fork 1.7k
A new asset freshness API #28828
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
A new asset freshness API #28828
Conversation
c87a0f4
to
45ee60e
Compare
2ed1a73
to
29d5a43
Compare
python_modules/dagster/dagster/_core/definitions/decorators/asset_decorator.py
Outdated
Show resolved
Hide resolved
29d5a43
to
c43e303
Compare
d26e982
to
18c9cfe
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.
not all the comments here are blocking, but the main thing is that I really don't think we can add a new non-hidden argument to AssetSpec that we plan to remove in the near future, especially due to the number of APIs we end up needing to thread this ephemeral parameter through.
python_modules/dagster/dagster/_core/definitions/decorators/asset_decorator.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/definitions/new_freshness_policy.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/definitions/new_freshness_policy.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/definitions/new_freshness_policy.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/definitions/new_freshness_policy.py
Outdated
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.
As discussed offline, let's move forward with the asset metadata storage approach for now
python_modules/dagster/dagster/_core/definitions/new_freshness_policy.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/definitions/new_freshness_policy.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/definitions/new_freshness_policy.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/definitions/remote_asset_graph.py
Outdated
Show resolved
Hide resolved
c56de48
to
985651a
Compare
6bab510
to
cf7f5bb
Compare
9b6754f
to
066d781
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.
Great work -- this feels way cleaner / safer. Had two extremely tiny changes, and also we should have a test that includes the @asset
decorator.
Approving as this is definitely in a mergeable state right now, just would prefer those changes to be made first.
..._modules/dagster/dagster/_core/definitions/decorators/decorator_assets_definition_builder.py
Outdated
Show resolved
Hide resolved
knew i was forgetting something lol |
3e9bd60
to
6d652e4
Compare
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit 1c20726. |
69eb992
to
d2b2743
Compare
I've ignored a couple of pyright errors, mainly stemming from the fact that we have a serdes class Pyright somehow cannot recognize that it is not possible to instantiate
because To me these feel safe enough to ignore for now to get this merged, if desired we can come up with a better solution in the future. |
ac60857
to
5d3a983
Compare
5d3a983
to
1c20726
Compare
Introduces a new API for defining freshness as a top-level attribute on an asset. This API will replace freshness checks and freshness policies as the way to model asset freshness in Dagster. For more details on the motivation behind needing a new API, please refer to the [internal product review](https://www.notion.so/dagster/New-Asset-Freshness-System-Product-Review-1c318b92e46280fe859ce86f5d78934a?d=1c718b92e462807ca2e1001c0a331dc0#1c718b92e46280c8973ef9358ec38367). The implementation here is slightly different than the desired end state, which is to reclaim the deprecated `FreshnessPolicy` construct. Instead we're writing the new freshness policy to the asset spec metadata. This will unblock internal testing and give us time to implement a longer-term migration plan for `FreshnessPolicy`. - Relocate `SerializableTimeDelta` from `dagster._core.definitions.declarative_automation.util` to `dagster_shared.serdes.utils` - new + existing unit tests for backward compatibility > Insert changelog entry or delete this section.
## Summary & Motivation Fixes a Python 3.9 backcompat issue with unit tests introduced in #28828. ## How I Tested These Changes bk ## Changelog > Insert changelog entry or delete this section.
## Summary & Motivation Fixes a Python 3.9 backcompat issue with unit tests introduced in #28828. ## How I Tested These Changes bk ## Changelog > Insert changelog entry or delete this section.
Summary & Motivation
Introduces a new API for defining freshness as a top-level attribute on an asset. This API will replace freshness checks and freshness policies as the way to model asset freshness in Dagster.
For more details on the motivation behind needing a new API, please refer to the internal product review.
The implementation here is slightly different than the desired end state, which is to reclaim the deprecated
FreshnessPolicy
construct. Instead we're writing the new freshness policy to the asset spec metadata. This will unblock internal testing and give us time to implement a longer-term migration plan forFreshnessPolicy
.Auxiliary Changes
SerializableTimeDelta
fromdagster._core.definitions.declarative_automation.util
todagster_shared.serdes.utils
How I Tested These Changes
Changelog