Skip to content

Commit

Permalink
fix: revert fix(presto preview): re-enable schema previsualization fo…
Browse files Browse the repository at this point in the history
…r Trino/Presto table/schemas" (apache#28613)
  • Loading branch information
john-bodley authored May 21, 2024
1 parent 62a0336 commit 4fa7619
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions superset/db_engine_specs/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,7 @@ def where_latest_partition(
}

for col_name, value in zip(col_names, values):
col_type = None
if col_type_name := column_type_by_name.get(col_name):
if col_type_class := getattr(types, col_type_name, None):
col_type = col_type_class()
col_type = column_type_by_name.get(col_name)

if isinstance(col_type, types.DATE):
col_type = Date()
Expand Down
8 changes: 4 additions & 4 deletions tests/unit_tests/db_engine_specs/test_presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ def test_get_schema_from_engine_params() -> None:
@pytest.mark.parametrize(
["column_type", "column_value", "expected_value"],
[
("DATE", "2023-05-01", "DATE '2023-05-01'"),
("TIMESTAMP", "2023-05-01", "TIMESTAMP '2023-05-01'"),
("VARCHAR", "2023-05-01", "'2023-05-01'"),
("INT", 1234, "1234"),
(types.DATE(), "2023-05-01", "DATE '2023-05-01'"),
(types.TIMESTAMP(), "2023-05-01", "TIMESTAMP '2023-05-01'"),
(types.VARCHAR(), "2023-05-01", "'2023-05-01'"),
(types.INT(), 1234, "1234"),
],
)
def test_where_latest_partition(
Expand Down

0 comments on commit 4fa7619

Please sign in to comment.