https://dagster.io/ logo
#dagster-feedback
Title
# dagster-feedback
r

Rasmus Bonnevie

05/10/2023, 8:42 AM
I've found the following pattern to be very useful alongside modern IDE code navigation tools and just generally to avoid miscoding dependencies:
Copy code
import external_asset from other_asset_module

@asset(ins={"input": AssetIn(key=external_asset.key))
def new_asset(input):
    ...
my only problem is that this interacts very poorly with the current
load_assets_from_modules
utilities you recommend since it will collect
external_asset
as well! This can become particularly confusing if
group_name
or a prefix is applied in the
load_*
function. Any recommendations or ways to support this style?
d

Daniel Gafni

05/10/2023, 9:02 AM
perhaps the other package should expose a module with only SourceAssets?
r

Rasmus Bonnevie

05/10/2023, 9:04 AM
source assets are also picked up by
load_assets_from_modules
I think
d

Daniel Gafni

05/10/2023, 9:05 AM
but that's what you want, no? if you asset depends on an external asset, it should be represented as SourceAsset
r

Rasmus Bonnevie

05/10/2023, 9:09 AM
It's in the same code location/repo, just a different module for organizational purposes. What I want is that if I do
load_assets_from_modules
on the module containing the above code, it retrieves
new_asset
but not
external_asset
(since I might need to apply a different group name/prefix to the latter). I believe it's recommended in the docs to use the
load_*
functions to populate
Definitions
and set group names on a module level.
current workarounds would be: • define the asset key as a variable and import that instead • set group names on assets manually and import manually into
Definitions
module •
d

Daniel Gafni

05/10/2023, 9:11 AM
oh I see, thank you, this makes sense
2 Views