bito-code-review[bot] commented on code in PR #35540:
URL: https://github.com/apache/superset/pull/35540#discussion_r2755688062


##########
superset/models/core.py:
##########
@@ -833,17 +833,17 @@ def select_star(  # pylint: disable=too-many-arguments
         cols: list[ResultSetColumnType] | None = None,
     ) -> str:
         """Generates a ``select *`` statement in the proper dialect"""
-        with self.get_sqla_engine(catalog=table.catalog, schema=table.schema) 
as engine:
-            return self.db_engine_spec.select_star(
-                self,
-                table,
-                engine=engine,
-                limit=limit,
-                show_cols=show_cols,
-                indent=indent,
-                latest_partition=latest_partition,
-                cols=cols,
-            )
+        dialect = self.get_dialect()
+        return self.db_engine_spec.select_star(
+            self,
+            table,
+            dialect=dialect,
+            limit=limit,
+            show_cols=show_cols,
+            indent=indent,
+            latest_partition=latest_partition,
+            cols=cols,
+        )

Review Comment:
   <!-- Bito Reply -->
   The review comment is wrong because the select_star method only builds a SQL 
string and doesn't open database connections—it only uses engine.dialect for 
string quoting. The original code unnecessarily created an engine and potential 
SSH tunnels just for the dialect, which the refactor avoids. get_dialect() 
creates no resources needing cleanup, so there's no leak risk. The change 
improves resource management by eliminating wasteful engine creation.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to