aniaan commented on a change in pull request #16624:
URL: https://github.com/apache/superset/pull/16624#discussion_r707572113



##########
File path: superset/models/core.py
##########
@@ -721,6 +721,28 @@ def has_table_by_name(self, table_name: str, schema: 
Optional[str] = None) -> bo
         engine = self.get_sqla_engine()
         return engine.has_table(table_name, schema)
 
+    @classmethod
+    def _has_view(
+        cls,
+        conn: Connection,
+        dialect: Dialect,
+        view_name: str,
+        schema: Optional[str] = None,
+    ) -> bool:
+        view_names: List[str] = []
+        try:
+            view_names = dialect.get_view_names(connection=conn, schema=schema)

Review comment:
       I tried to add test cases. Please review. The problem is essentially 
that there is no judgment on the view, but I found the problem when I happened 
to use ES, so I think the test case should be judged for the general view. Not 
just ES




-- 
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