Robert Lawson
08/29/2023, 12:14 PMdefault
asset gorup. Previously I could use the key_prefix
arg when calling load_assets_from_dbt_project
, and the dbt assets would be in an asset group with the name of the key_prefix, but that no longer seems to work.
dbt_assets = load_assets_from_dbt_project(
project_dir=DBT_PROJECT_PATH,
profiles_dir=DBT_PROFILES,
# key_prefix=["categorization"], #The old way that worked
dagster_dbt_transator=CatModuleDagsterDbtTranslator(), # The new way that I need to use
)
shows the difference. I also need to define a class just to specify the name
class CatModuleDagsterDbtTranslator(DagsterDbtTranslator):
....
def get_group_name(self, dbt_resource_props: Mapping[str, Any]) -> Optional[str]:
return "categorization"
Is this intended behaviour?
Edit: wrote dagster_dbt_resource, meant dagster_dbt_translator of course.Brendan Jackson
08/29/2023, 1:13 PM@classmethod
override.Robert Lawson
08/29/2023, 1:17 PMget_asset_key
did not work
class CatModuleDagsterDbtTranslator(DagsterDbtTranslator):
@classmethod
def get_asset_key(cls, dbt_resource_props: Mapping[str, Any]) -> AssetKey:
answer = super().get_asset_key(dbt_resource_props).with_prefix("the_key_prefix")
return answer
def get_group_name(self, dbt_resource_props: Mapping[str, Any]) -> Optional[str]:
return "categorization"
still gives meRobert Lawson
08/29/2023, 1:18 PM