Skip to content

Commit

Permalink
Skip invisible tables (#268)
Browse files Browse the repository at this point in the history
* Skip tables that are technical not just hidden (#267)

Tables are hidden with any non-nil value - we hide our tables with  `technical` so would be useful to update this.

* Allow other table hidden values

---------

Co-authored-by: Chris Parsons <[email protected]>
  • Loading branch information
gouline and chrismdp authored Jul 19, 2024
1 parent 9edebe0 commit 2fd386a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dbtmetabase/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def export_models(

field = table.get("fields", {}).get(column_name)
if not field:
if table.get("visibility_type") == "hidden":
if table.get("visibility_type") is not None:
table_label = "hidden table"
table["stale"] = True
else:
Expand Down Expand Up @@ -189,8 +189,8 @@ def __export_model(

# Going from hidden to visible may require a retry
retryable = (
api_table.get("visibility_type") == "hidden"
and model_visibility != "hidden"
api_table.get("visibility_type") is not None
and model_visibility is None
and api_table.get("stale", False)
)

Expand Down Expand Up @@ -221,7 +221,7 @@ def __export_model(
else:
_logger.info("Table '%s' is up to date", table_key)

if model_visibility == "hidden":
if model_visibility is not None:
_logger.info("Table '%s' is hidden, skipping columns", table_key)
return success

Expand Down

0 comments on commit 2fd386a

Please sign in to comment.