korbit-ai[bot] commented on code in PR #34613: URL: https://github.com/apache/superset/pull/34613#discussion_r2272007336
########## 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: Agreed, using sqlglot would be a more robust approach. It could handle the alias syntax correctly across all dialects rather than having Oracle-specific code. Would you like me to suggest a sqlglot-based implementation? -- 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