From 2fd386ad97df71077ea46be6af9828d73b0e5ac1 Mon Sep 17 00:00:00 2001 From: Mike Gouline <1960272+gouline@users.noreply.github.com> Date: Fri, 19 Jul 2024 20:41:15 +1000 Subject: [PATCH] Skip invisible tables (#268) * 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 --- dbtmetabase/_models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbtmetabase/_models.py b/dbtmetabase/_models.py index aed92380..08d5c853 100644 --- a/dbtmetabase/_models.py +++ b/dbtmetabase/_models.py @@ -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: @@ -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) ) @@ -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