john-bodley commented on code in PR #28317:
URL: https://github.com/apache/superset/pull/28317#discussion_r1591395450
##########
superset/db_engine_specs/base.py:
##########
@@ -1412,24 +1426,24 @@ def get_catalog_names( # pylint:
disable=unused-argument
cls,
database: Database,
inspector: Inspector,
- ) -> list[str]:
+ ) -> set[str]:
"""
Get all catalogs from database.
This needs to be implemented per database, since SQLAlchemy doesn't
offer an
abstraction.
"""
- return []
+ return set()
@classmethod
- def get_schema_names(cls, inspector: Inspector) -> list[str]:
+ def get_schema_names(cls, inspector: Inspector) -> set[str]:
"""
Get all schemas from database
:param inspector: SqlAlchemy inspector
:return: All schemas in the database
"""
- return sorted(inspector.get_schema_names())
Review Comment:
@betodealmeida @dpgaspar et al. the reason _I believe_ this was a sorted
list (as opposed to a set) was to ensure the results were always consistently
rendered in SQL Lab et al. I don't disagree that a set is a more appropriate
container, but it's contents aren't ordered. Maybe we should being using the
[ordered-set](https://pypi.org/project/ordered-set/) package for improved
transparency.
CC @michael-s-molina
--
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]