Skip to content

Instantly share code, notes, and snippets.

@slopp
Created June 27, 2024 18:04
Show Gist options
  • Save slopp/2ef897b7399816d2fe1b5feb9407653d to your computer and use it in GitHub Desktop.
Save slopp/2ef897b7399816d2fe1b5feb9407653d to your computer and use it in GitHub Desktop.
Custom dagster asset decorator
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