mistercrunch commented on code in PR #28875: URL: https://github.com/apache/superset/pull/28875#discussion_r1630410660
########## superset/connectors/sqla/utils.py: ########## @@ -137,18 +134,9 @@ def get_columns_description( schema: str | None, query: str, ) -> list[ResultSetColumnType]: - # TODO(villebro): refactor to use same code that's used by - # sql_lab.py:execute_sql_statements - db_engine_spec = database.db_engine_spec try: - with database.get_raw_connection(catalog=catalog, schema=schema) as conn: - cursor = conn.cursor() - query = database.apply_limit_to_sql(query, limit=1) - cursor.execute(query) - db_engine_spec.execute(cursor, query, database) - result = db_engine_spec.fetch_data(cursor, limit=1) - result_set = SupersetResultSet(result, cursor.description, db_engine_spec) - return result_set.columns + result_set = database.get_result_set(query, catalog, schema, limit=1) Review Comment: Streamlining with a factored-out `Dataset.get_result_set` -- 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