Skip to content

Commit

Permalink
Debug depends file
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Oct 16, 2024
1 parent caa16ad commit a2b0617
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dbtmetabase/_exposures.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def extract_exposures(

exposures = []
counts: MutableMapping[str, int] = {}
all_depends = set()

for collection in self.metabase.get_collections(
exclude_personal=not allow_personal_collections
Expand Down Expand Up @@ -197,6 +198,9 @@ def extract_exposures(
count = counts.get(name, 0)
counts[name] = count + 1

for depend in depends:
all_depends.add(depend)

exposures.append(
{
"id": item["id"],
Expand Down Expand Up @@ -229,6 +233,15 @@ def extract_exposures(

self.__write_exposures(exposures, output_path, output_grouping)

with open(Path(output_path) / "depends.yaml", "w", encoding="utf-8") as f:
dump_yaml(
data={
"models": ctx.model_refs,
"depends": list(all_depends),
},
stream=f,
)

return exposures

def __extract_card_exposures(
Expand Down

0 comments on commit a2b0617

Please sign in to comment.