michael-s-molina commented on code in PR #30017:
URL: https://github.com/apache/superset/pull/30017#discussion_r1732667398


##########
superset/migrations/shared/utils.py:
##########
@@ -168,3 +168,18 @@ def try_load_json(data: Optional[str]) -> dict[str, Any]:
     except json.JSONDecodeError:
         print(f"Failed to parse: {data}")
         return {}
+
+
+def has_table(table_name: str) -> bool:
+    """
+    Check if a table exists in the database.
+
+    :param table_name: The table name
+    :returns: True if the table exists
+    """
+
+    insp = inspect(op.get_context().bind)
+    table_exists = insp.has_table(table_name)
+
+    print(f"Table {table_name} exist: {table_exists}")

Review Comment:
   Maybe delete this print? If not, then:
   ```suggestion
       print(f"Table {table_name} exists: {table_exists}")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to