Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed Mar 31, 2022
1 parent 62fda63 commit 40c48e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def sql_url(self) -> str:
def external_metadata(self) -> List[Dict[str, str]]:
# todo(yongjie): create a pysical table column type in seprated PR
if self.sql:
return get_virtual_table_metadata(dataset=self)
return get_virtual_table_metadata(dataset=self) # type: ignore
return get_physical_table_metadata(
database=self.database,
table_name=self.table_name,
Expand Down
3 changes: 2 additions & 1 deletion superset/connectors/sqla/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from superset.models.core import Database
from superset.result_set import SupersetResultSet
from superset.sql_parse import has_table_query, ParsedQuery, Table
from superset.superset_typing import ResultSetColumnType
from superset.tables.models import Table as NewTable

if TYPE_CHECKING:
Expand Down Expand Up @@ -91,7 +92,7 @@ def get_physical_table_metadata(
return cols


def get_virtual_table_metadata(dataset: "SqlaTable") -> List[Dict[str, str]]:
def get_virtual_table_metadata(dataset: "SqlaTable") -> List[ResultSetColumnType]:
"""Use SQLparser to get virtual dataset metadata"""
if not dataset.sql:
raise SupersetGenericDBErrorException(
Expand Down
5 changes: 4 additions & 1 deletion tests/integration_tests/db_engine_specs/presto_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,10 @@ def test_select_star_presto_expand_data(
True,
True,
True,
[{"name": "val1"}, {"name": "val2<?!@#$312,/'][p098"},],
[
{"name": "val1"},
{"name": "val2<?!@#$312,/'][p098"},
],
)

def test_estimate_statement_cost(self):
Expand Down

0 comments on commit 40c48e8

Please sign in to comment.