Skip to content

Change from ConvertibleToAssetDep to CoercibleToAssetDep #54

@lucargir

Description

@lucargir

When using Dagster with containerised code locations, if the asset dependencies are created with AssetDep, Dagster will create an asset definition even if it's for an external asset, leading to the following error in the UI:

Multiple asset definitions found
This asset was loaded from dlthub, but duplicate definitions were found in 1 other repo. You should rename these assets to avoid collisions.

Would it be possible to refactor the code so instead of using dagster_sqlmesh.types.ConvertibleToAssetDep we use dagster's CoercibleToAssetDep?

CoercibleToAssetDep = Union[
    CoercibleToAssetKey, "AssetSpec", "AssetsDefinition", "SourceAsset", "AssetDep"
]

Then the translator can be adapted accordingly by the end user, and instead of the return type for the SQLMeshDagsterTranslator.create_asset_dep being ConvertibleToAssetDep, it should be dagster's CoercibleToAssetDep.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions