Skip to content

Commit

Permalink
chore: Default to engine specification regarding using wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley committed Apr 1, 2024
1 parent 5e8459b commit e40cb90
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion superset/databases/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def select_star(
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

Check warning on line 868 in superset/databases/api.py

View check run for this annotation

Codecov / codecov/patch

superset/databases/api.py#L868

Added line #L868 was not covered by tests
)
except NoSuchTableError:
self.incr_stats("error", self.select_star.__name__)
Expand Down
1 change: 0 additions & 1 deletion superset/databases/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/databases/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ def test_get_invalid_table_table_metadata(self):
"indexes": [],
"name": "wrong_table",
"primaryKey": {"constrained_columns": None, "name": None},
"selectStar": "SELECT\nFROM wrong_table\nLIMIT 100\nOFFSET 0",
"selectStar": "SELECT *\nFROM wrong_table\nLIMIT 100\nOFFSET 0",
},
)
elif example_db.backend == "mysql":
Expand Down
6 changes: 2 additions & 4 deletions tests/integration_tests/db_engine_specs/presto_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,16 +867,14 @@ def test_select_star_presto_expand_data(
{"column_name": "val.2"},
{"column_name": ".val2."},
]
PrestoEngineSpec.select_star(
database, table_name, engine, show_cols=True, cols=cols
)
PrestoEngineSpec.select_star(database, table_name, engine, cols=cols)
mock_select_star.assert_called_once_with(
database,
table_name,
engine,
None,
100,
True,
False,
True,
True,
[
Expand Down

0 comments on commit e40cb90

Please sign in to comment.