<@U0667DNC02Y> In dbt i define the asset keys by p...
# ask-ai
e
@Scout In dbt i define the asset keys by passing a list of string so dagster will construct my asset key. The issue is that those asset key need to have a matching name with the assets key I create for my fivetran assets. here is how I define my fivetran asset :
formatted_op_name = f"{op_name}/{table_name.split('.')[-1]}"
I get this error : 2024-02-22 100847 +0100 - dagster.daemon.SensorDaemon - WARNING - Could not load location jobs.py to check for sensors due to the following error: dagster.core.errors.DagsterInvalidDefinitionError: "base/account" is not a valid name in Dagster. Names must be in regex ^[A-Za-z0-9]+$. but in dbt when I look at the ui my asset key is base/account
s
Based on the documentation, Dagster has specific naming conventions for asset keys. Asset keys in Dagster must match the regex pattern
^[A-Za-z0-9_]+$
, which means they can only contain alphanumeric characters and underscores. The error message you're encountering indicates that the asset key "base/account" is not valid because it contains a forward slash (
/
), which is not allowed according to the naming conventions. In the case of dbt, it seems that you are able to define asset keys with a forward slash, but when integrating with Dagster, you need to ensure that the asset keys conform to Dagster's naming requirements. This discrepancy is causing the error you're seeing. To resolve this issue, you would need to adjust the way you're generating the asset keys in Dagster to remove or replace any characters that are not alphanumeric or underscores. For example, you could replace the forward slash with an underscore to create a valid Dagster asset key:
Copy code
python formatted_op_name = f"{op_name}_{table_name.split('.')[-1]}"
This change should help you avoid the
DagsterInvalidDefinitionError
and allow you to create asset keys that are compatible with both dbt and Dagster. Remember to apply this naming convention consistently across all asset keys you define in Dagster to ensure compatibility.