Julius
04/27/2023, 10:57 AMins
parameters in define_dagstermill_asset
jupyter_notebook = define_dagstermill_asset(
name=f"jupyter_notebook_{source}",
notebook_path=file_relative_path(__file__, "./notebooks/jupyter-sql-snowflake.ipynb"),
ins={
"config": AssetIn(f"config_key_{source}"), <----------- this input
},
partitions_def=partitions_dict[f"fivetran_{source}"],
group_name="jupyter_notebook",
)
Zach
04/27/2023, 3:15 PMJulius
04/27/2023, 4:22 PMZach
04/27/2023, 4:28 PMJulius
04/27/2023, 5:08 PMchris
04/27/2023, 5:38 PMpartition_key
from dagstermill.Julius
04/28/2023, 2:17 AM@asset(
group_name="jupyter_notebook",
name="config_key",
partitions_def=partitions_dict[f"fivetran_{source}"],
)
def config_key(context):
partition_key = context.asset_partition_key_for_output() <---------using this as the output
return partition_key
# Asset backed by a Jupyter notebook
jupyter_notebook = define_dagstermill_asset(
name="jupyter_notebook",
notebook_path=file_relative_path(__file__, "./notebooks/jupyter-sql-snowflake.ipynb"),
ins={
"partition_key": AssetIn("config_key"),
},
partitions_def=partitions_dict[f"fivetran_{source}"],
group_name="jupyter_notebook",
)
Hi guy, I figure out a way how to pass the partition-key to jupyter notebook asset, that is using asset_partition_key_for_output
and returning the partition-key as the output of the upstream.