You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2024/04/04 12:04:25 UTC

(superset) 01/03: chore: Default to engine specification regarding using wildcard (#27843)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 80ccb0c51fed28a12e145c1c733fc582f2fd9a99
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Wed Apr 3 09:09:37 2024 -0700

    chore: Default to engine specification regarding using wildcard (#27843)
    
    (cherry picked from commit 30bc8f06dc822080e56633a3dcf3bcc0546e54d9)
---
 superset/databases/api.py                      | 2 +-
 superset/databases/utils.py                    | 1 -
 tests/integration_tests/databases/api_tests.py | 4 +---
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/superset/databases/api.py b/superset/databases/api.py
index 62fb729437..c0662b5d75 100644
--- a/superset/databases/api.py
+++ b/superset/databases/api.py
@@ -864,7 +864,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
         self.incr_stats("init", self.select_star.__name__)
         try:
             result = database.select_star(
-                table_name, schema_name, latest_partition=True, show_cols=True
+                table_name, schema_name, latest_partition=True
             )
         except NoSuchTableError:
             self.incr_stats("error", self.select_star.__name__)
diff --git a/superset/databases/utils.py b/superset/databases/utils.py
index 21abd7b9c2..8de4bb6f23 100644
--- a/superset/databases/utils.py
+++ b/superset/databases/utils.py
@@ -92,7 +92,6 @@ def get_table_metadata(
         "selectStar": database.select_star(
             table_name,
             schema=schema_name,
-            show_cols=True,
             indent=True,
             cols=columns,
             latest_partition=True,
diff --git a/tests/integration_tests/databases/api_tests.py b/tests/integration_tests/databases/api_tests.py
index 0bc1f245a1..9d28bd941b 100644
--- a/tests/integration_tests/databases/api_tests.py
+++ b/tests/integration_tests/databases/api_tests.py
@@ -1280,7 +1280,7 @@ class TestDatabaseApi(SupersetTestCase):
                     "indexes": [],
                     "name": "wrong_table",
                     "primaryKey": {"constrained_columns": None, "name": None},
-                    "selectStar": "SELECT\nFROM wrong_table\nLIMIT 100\nOFFSET 0",
+                    "selectStar": "SELECT\n  *\nFROM wrong_table\nLIMIT 100\nOFFSET 0",
                 },
             )
         elif example_db.backend == "mysql":
@@ -1350,8 +1350,6 @@ class TestDatabaseApi(SupersetTestCase):
         uri = f"api/v1/database/{example_db.id}/select_star/birth_names/"
         rv = self.client.get(uri)
         self.assertEqual(rv.status_code, 200)
-        response = json.loads(rv.data.decode("utf-8"))
-        self.assertIn("gender", response["result"])
 
     def test_get_select_star_not_allowed(self):
         """