Created
June 27, 2024 18:04
-
-
Save slopp/2ef897b7399816d2fe1b5feb9407653d to your computer and use it in GitHub Desktop.
Custom dagster asset decorator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dagster import asset | |
# add an attribute to all assets using this decorator without users having to adjust it | |
def bi_team_asset(**asset_decorator_kwargs): | |
def _wrapper(f): | |
@asset(**asset_decorator_kwargs, owners=["bi@corp.org"], name=f.__name__) | |
def _impl(**kwargs): | |
return f(**kwargs) | |
return _impl | |
return _wrapper | |
@bi_team_asset(compute_kind="dbt") | |
def an_asset(): | |
print("hello") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment