@@ -802,7 +802,7 @@ def create_connect_args(self, url):
802802 )
803803 return ([client ], {})
804804
805- def _get_table_or_view_names (self , connection , table_type , schema = None ):
805+ def _get_table_or_view_names (self , connection , item_types , schema = None ):
806806 current_schema = schema or self .dataset_id
807807 get_table_name = (
808808 self ._build_formatted_table_id
@@ -823,7 +823,7 @@ def _get_table_or_view_names(self, connection, table_type, schema=None):
823823 dataset .reference , page_size = self .list_tables_page_size
824824 )
825825 for table in tables :
826- if table_type == table .table_type :
826+ if table .table_type in item_types :
827827 result .append (get_table_name (table ))
828828 except google .api_core .exceptions .NotFound :
829829 # It's possible that the dataset was deleted between when we
@@ -976,13 +976,15 @@ def get_table_names(self, connection, schema=None, **kw):
976976 if isinstance (connection , Engine ):
977977 connection = connection .connect ()
978978
979- return self ._get_table_or_view_names (connection , "TABLE" , schema )
979+ item_types = ["TABLE" , "EXTERNAL" ]
980+ return self ._get_table_or_view_names (connection , item_types , schema )
980981
981982 def get_view_names (self , connection , schema = None , ** kw ):
982983 if isinstance (connection , Engine ):
983984 connection = connection .connect ()
984985
985- return self ._get_table_or_view_names (connection , "VIEW" , schema )
986+ item_types = ["VIEW" , "MATERIALIZED_VIEW" ]
987+ return self ._get_table_or_view_names (connection , item_types , schema )
986988
987989 def do_rollback (self , dbapi_connection ):
988990 # BigQuery has no support for transactions.
0 commit comments