Hi, is it possible for a multi_asset_sensor to use...
# ask-community
j
Hi, is it possible for a multi_asset_sensor to use both the
asset_selection
and
asset_keys
? Example in 🧵
We have this multi_asset_sensor. The fivetran assets are software defined while the
prod_data
is a just an asset materialisation. This currently does not pull through the prod_data asset key into the asset sensor cursor. Is it possible to use both?
Copy code
@multi_asset_sensor(
    asset_selection=AssetSelection.assets(
        *fivetran_csv_seed_assets,
        *fivetran_braintree_assets,
        *fivetran_salesforce_assets,
        *fivetran_intercom_assets,
    ),
    asset_keys=[AssetKey("prod_data")],
    job=main_pipeline,
    name="trigger_main_pipeline",
)
def trigger_main_pipeline(context):
...
j
Hi @Jamie Lee you can add the asset
prod_data
to your AssetSelection like this
Copy code
asset_selection=AssetSelection.assets(
        *fivetran_csv_seed_assets,
        *fivetran_braintree_assets,
        *fivetran_salesforce_assets,
        *fivetran_intercom_assets,
    ) | AssetSelection.keys("prod_data"),
and then remove the
asset_keys
parameter
❤️ 1
👍 1
j
Hi @jamie, we just tried this and it didn’t work 😞 Error message below:
Copy code
AssetKey(s) {AssetKey(['prod_data'])} were selected, but no AssetsDefinition objects supply these keys. Make sure all keys are spelled correctly, and all AssetsDefinitions are correctly added to the repository.
As mentioned the
AssetKey(['prod_data'])
is just an AssetMaterialisation. Should this still work?
j
ohhh, I’m sorry, i missed that
prod_data
is just an asset materialization. in that case, I don’t believe this will work