Aaron T
05/05/2023, 2:31 PM# __init__.py
from ..assets import asset_1
defs = Definitions(
assets=[
*load_assets_from_modules([asset_1], group_name='asset_1_assets')
]
)
I load dagit, and I can see defined in my "Asset Groups" - asset_1_assets
. Now, I reference an asset in a different module, and add the job to my __init__.py
-
##### job_1.py
from ..assets.asset_1 import asset_1
@job
def job_1():
op_1(asset_1.to_source_asset())
##### __init__.py
from ..assets import asset_1
defs = Definitions(
assets=[
*load_assets_from_modules([asset_1], group_name='asset_1_assets')
],
jobs=BindResourcesToJobs([job_1]),
schedules=[ScheduledDefinition(...)]
)
reload dagit and now I can no longer see the "Asset Group" asset_1_assets
, it is now listed under the default
"Asset Group." -- What is the reason behind this?yuhan
05/05/2023, 6:03 PMyuhan
05/05/2023, 6:23 PMfrom ..assets import asset_1
whatโs asset_1? is it a python module or package?yuhan
05/05/2023, 6:23 PM..assets
have an __init__
file?Aaron T
05/05/2023, 6:23 PMyuhan
05/05/2023, 6:24 PMyuhan
05/05/2023, 6:25 PMfrom ..assets.asset_1 import asset_1
this line might be the thing confuses python. is your asset and the file the same name?Aaron T
05/05/2023, 6:28 PMfrom ..assets.asset_1 import asset_file_1
Aaron T
05/05/2023, 6:28 PMAaron T
05/05/2023, 6:32 PMdata_pipeline/
โโ assets/
โ โโ asset_1_name/
โ โ โโ asset_1.py
| | โ โโ def asset_1_job()
โ โ โโ __init__.py
โ โโ __init__.py
โโ jobs/
โ โโ foo_jobs/
โ โ โโ foo_job_defs.py
| | โ โโ def job_1()
โ โโ index.html
โ โโ robots.txt
โโ __init__.py
Aaron T
05/05/2023, 6:33 PMAaron T
05/05/2023, 6:34 PMyuhan
05/05/2023, 6:36 PMyuhan
05/05/2023, 6:37 PMAaron T
05/05/2023, 7:02 PMAaron T
05/08/2023, 2:24 PMyuhan
05/08/2023, 10:14 PMBindResourcesToJobs
as in:
defs = Definitions(
assets=[
*load_assets_from_modules([asset_1_file], group_name='test_group_name')
],
jobs=[my_job.my_job]
)
it was for 1.2-1.3 where the new config and resources were still experimental so we made that opt-in.yuhan
05/08/2023, 10:15 PMBindResourcesToJobs
and it worked fine for me.Aaron T
05/09/2023, 3:24 AMAaron T
05/09/2023, 3:25 AMAaron T
05/09/2023, 3:27 AMAaron T
05/09/2023, 6:51 PMBindResourcesToJobs
didn't have any affectyuhan
05/09/2023, 8:22 PMjobs=[โฆ]
on Definitions
seems doing something offyuhan
05/09/2023, 8:27 PMgroup_name
on the asset itself, here:
@asset(group_name="test_group_name")
def asset_1(context):
return 123
Aaron T
05/10/2023, 4:07 AMyuhan
05/10/2023, 4:25 PMAaron T
05/11/2023, 3:16 AMyuhan
05/12/2023, 6:36 PM