geoHeil
08/16/2023, 12:43 PMrex
08/16/2023, 1:47 PMdef default_description_fn(dbt_resource_props: Mapping[str, Any], display_raw_sql: bool = True):
code_block = textwrap.indent(
dbt_resource_props.get("raw_sql") or dbt_resource_props.get("raw_code", ""), " "
)
description_sections = [
dbt_resource_props["description"]
or f"dbt {dbt_resource_props['resource_type']} {dbt_resource_props['name']}",
]
if display_raw_sql:
description_sections.append(f"#### Raw SQL:\n```\n{code_block}\n```")
return "\n\n".join(filter(None, description_sections))
The raw SQL is displayed by default. If you want to change this behavior, then you can implement your own get_description
for `DagsterDbtTranslator`: https://docs.dagster.io/integrations/dbt/reference#customizing-descriptionsgeoHeil
08/16/2023, 1:49 PMrex
08/16/2023, 1:52 PMcompiled_code
. This is referencing the raw_code
. They are not the same.
In the code i posted above:
dbt_resource_props.get("raw_code", "")
geoHeil
08/16/2023, 1:53 PM