hy144328 commented on code in PR #41917:
URL: https://github.com/apache/superset/pull/41917#discussion_r3563998130
##########
superset/db_engine_specs/starrocks.py:
##########
@@ -344,24 +344,25 @@ def get_catalog_names(
The command returns columns: Catalog, Type, Comment
"""
try:
- result = inspector.bind.execute(text("SHOW CATALOGS"))
- catalogs = set()
-
- for row in result:
- try:
- if hasattr(row, "keys") and "Catalog" in row.keys():
- catalogs.add(row["Catalog"])
- elif hasattr(row, "Catalog"):
- catalogs.add(row.Catalog)
- else:
- catalogs.add(row[0])
- except (AttributeError, TypeError, IndexError, KeyError) as ex:
- logger.warning(
- "Unable to extract catalog name from row: %s (%s)",
row, ex
- )
- continue
-
- return catalogs
+ with inspector.engine.connect() as conn:
+ result = conn.execute(text("SHOW CATALOGS"))
+ catalogs = set()
Review Comment:
Not a regression.
--
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]