mistercrunch commented on code in PR #34766: URL: https://github.com/apache/superset/pull/34766#discussion_r2289295784
########## superset/db_engine_specs/bigquery.py: ########## @@ -828,3 +828,97 @@ def parse_error_exception(cls, exception: Exception) -> Exception: # If for some reason we get an exception, for example, no new line # We will return the original exception return exception + + @classmethod + def get_materialized_view_names( + cls, + database: Database, + inspector: Inspector, + schema: str | None, + ) -> set[str]: + """ + Get all materialized views from BigQuery. + + BigQuery materialized views are not returned by the standard + get_view_names() method, so we need to query INFORMATION_SCHEMA directly. + """ + if not schema: + return set() + + # Construct the query to get materialized views from INFORMATION_SCHEMA + if catalog := database.get_default_catalog(): + information_schema = f"`{catalog}.{schema}.INFORMATION_SCHEMA.TABLES`" Review Comment: NIT: I feel like similar logic exists in so many places that it's not clear to me where it belongs! -- 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org