Emrullah Ergun
02/22/2024, 9:12 AMformatted_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/accountScout
02/22/2024, 9:12 AM^[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: 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.