diff --git a/dbtmetabase/_exposures.py b/dbtmetabase/_exposures.py index 08251d4..b6c951e 100644 --- a/dbtmetabase/_exposures.py +++ b/dbtmetabase/_exposures.py @@ -80,11 +80,14 @@ def extract_exposures( ctx = self.__Context( model_refs={m.alias_path.lower(): m.ref for m in models if m.ref}, - database_names={d["id"]: d["name"] for d in self.metabase.get_databases()}, + database_names={ + d["id"]: d["details"].get("dbname", d["name"]) + for d in self.metabase.get_databases() + }, table_names={ t["id"]: ".".join( [ - t.get("db", {}).get("name", ""), + t["db"]["details"].get("dbname", t["db"]["name"]), t.get("schema", DEFAULT_SCHEMA), t["name"], ]