Skip to content

Commit

Permalink
Reference databases by dbname
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Oct 16, 2024
1 parent 10bb875 commit b7723eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dbtmetabase/_exposures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
]
Expand Down

0 comments on commit b7723eb

Please sign in to comment.