Vitor-Avila commented on code in PR #34613: URL: https://github.com/apache/superset/pull/34613#discussion_r2272007001
########## superset/jinja_context.py: ########## @@ -948,7 +948,12 @@ def dataset_macro( } sqla_query = dataset.get_query_str_extended(query_obj, mutate=False) sql = sqla_query.sql - return f"(\n{sql}\n) AS dataset_{dataset_id}" + # Check database type to determine whether to use AS keyword + database_type = dataset.database.backend.lower() + if database_type == 'oracle': + return f"(\n{sql}\n) dataset_{dataset_id}" + else: + return f"(\n{sql}\n) AS dataset_{dataset_id}" Review Comment: hmm I wonder if we could use `sqlglot` to either write the query, or decide if the `AS` keyword is needed? It would be interesting to use `sqlglot` so that the fix is not Oracle-specific. -- 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