Skip to content

Commit

Permalink
filter out internal Metabase tables (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline authored Jan 30, 2025
1 parent 7a5425c commit 93782cb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion dbtmetabase/metabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ def get_database_metadata(self, uid: str) -> Mapping:

def get_tables(self) -> Sequence[Mapping]:
"""Retrieves all tables for all databases."""
return list(self._api("get", "/api/table"))
return list(
filter(
lambda x: "details" in x["db"], # exclude internal
self._api("get", "/api/table"),
)
)

def get_collections(self, exclude_personal: bool) -> Sequence[Mapping]:
"""Retrieves all collections and optionally filters out personal collections."""
Expand Down
2 changes: 1 addition & 1 deletion sandbox/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
restart: always

metabase:
image: metabase/metabase:v0.50.29
image: metabase/metabase:v0.52.8
environment:
- MB_SETUP_TOKEN=${MB_SETUP_TOKEN:-}
- MB_DB_FILE=/metabase-data/metabase.db
Expand Down
Binary file modified sandbox/metabase.db/metabase.db.mv.db
Binary file not shown.
5 changes: 3 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 93782cb

Please sign in to comment.