You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2023/04/05 22:58:23 UTC
[superset] branch presto_get_catalog_names created (now 739445fc3e)
This is an automated email from the ASF dual-hosted git repository.
beto pushed a change to branch presto_get_catalog_names
in repository https://gitbox.apache.org/repos/asf/superset.git
at 739445fc3e feat(presto) `get_catalog_names`
This branch includes the following new commits:
new 739445fc3e feat(presto) `get_catalog_names`
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[superset] 01/01: feat(presto) `get_catalog_names`
Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch presto_get_catalog_names
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 739445fc3e902624d9b8b2884557b5f8da161d36
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Wed Apr 5 15:58:02 2023 -0700
feat(presto) `get_catalog_names`
---
superset/db_engine_specs/postgres.py | 2 +-
superset/db_engine_specs/presto.py | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/superset/db_engine_specs/postgres.py b/superset/db_engine_specs/postgres.py
index e52e69d7e8..352c9f466b 100644
--- a/superset/db_engine_specs/postgres.py
+++ b/superset/db_engine_specs/postgres.py
@@ -310,7 +310,7 @@ class PostgresEngineSpec(PostgresBaseEngineSpec, BasicParametersMixin):
SELECT datname FROM pg_database
WHERE datistemplate = false;
"""
- ).fetchall()
+ )
)
@classmethod
diff --git a/superset/db_engine_specs/presto.py b/superset/db_engine_specs/presto.py
index c0b4f2c6dd..a9b4f7aa60 100644
--- a/superset/db_engine_specs/presto.py
+++ b/superset/db_engine_specs/presto.py
@@ -785,6 +785,17 @@ class PrestoEngineSpec(PrestoBaseEngineSpec):
results = cursor.fetchall()
return {row[0] for row in results}
+ @classmethod
+ def get_catalog_names(
+ cls,
+ database: Database,
+ inspector: Inspector,
+ ) -> List[str]:
+ """
+ Get all catalogs.
+ """
+ return [catalog for (catalog,) in inspector.bind.execute("SHOW CATALOGS")]
+
@classmethod
def _create_column_info(
cls, name: str, data_type: types.TypeEngine