Skip to content

Commit

Permalink
feat: Consider Model description as well
Browse files Browse the repository at this point in the history
  • Loading branch information
sabino committed Nov 26, 2024
1 parent 10d2a70 commit c3a2bc9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions dbtmetabase/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ def _read_model(
for column in manifest_model.get("columns", {}).values()
]

scanned_fields = self._scan_fields(
manifest_model.get("meta", {}),
fields=_MODEL_META_FIELDS,
ns=_META_NS,
)

return Model(
database=database,
schema=schema,
Expand All @@ -119,16 +125,12 @@ def _read_model(
alias=manifest_model.get(
"alias", manifest_model.get("identifier", manifest_model["name"])
),
description=manifest_model.get("description"),
description=scanned_fields.get("description", manifest_model.get("description")),
columns=columns,
unique_id=unique_id,
source=source,
tags=manifest_model.get("tags", []),
**self._scan_fields(
manifest_model.get("meta", {}),
fields=_MODEL_META_FIELDS,
ns=_META_NS,
),
**{key: value for key, value in scanned_fields.items() if key != "description"},
)

def _read_column(
Expand Down

0 comments on commit c3a2bc9

Please sign in to comment.