mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: save columns reference from sqllab save datasets flow (#24248)
This commit is contained in:
@@ -46,6 +46,7 @@ from superset.exceptions import SupersetException
|
||||
from superset.extensions import cache_manager
|
||||
from superset.models.sql_lab import Query
|
||||
from superset.sql_parse import ParsedQuery, Table
|
||||
from superset.superset_typing import ResultSetColumnType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# prevent circular imports
|
||||
@@ -407,8 +408,8 @@ class HiveEngineSpec(PrestoEngineSpec):
|
||||
@classmethod
|
||||
def get_columns(
|
||||
cls, inspector: Inspector, table_name: str, schema: str | None
|
||||
) -> list[dict[str, Any]]:
|
||||
return inspector.get_columns(table_name, schema)
|
||||
) -> list[ResultSetColumnType]:
|
||||
return BaseEngineSpec.get_columns(inspector, table_name, schema)
|
||||
|
||||
@classmethod
|
||||
def where_latest_partition( # pylint: disable=too-many-arguments
|
||||
@@ -417,7 +418,7 @@ class HiveEngineSpec(PrestoEngineSpec):
|
||||
schema: str | None,
|
||||
database: Database,
|
||||
query: Select,
|
||||
columns: list[dict[str, Any]] | None = None,
|
||||
columns: list[ResultSetColumnType] | None = None,
|
||||
) -> Select | None:
|
||||
try:
|
||||
col_names, values = cls.latest_partition(
|
||||
@@ -436,7 +437,7 @@ class HiveEngineSpec(PrestoEngineSpec):
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def _get_fields(cls, cols: list[dict[str, Any]]) -> list[ColumnClause]:
|
||||
def _get_fields(cls, cols: list[ResultSetColumnType]) -> list[ColumnClause]:
|
||||
return BaseEngineSpec._get_fields(cols) # pylint: disable=protected-access
|
||||
|
||||
@classmethod
|
||||
@@ -481,7 +482,7 @@ class HiveEngineSpec(PrestoEngineSpec):
|
||||
show_cols: bool = False,
|
||||
indent: bool = True,
|
||||
latest_partition: bool = True,
|
||||
cols: list[dict[str, Any]] | None = None,
|
||||
cols: list[ResultSetColumnType] | None = None,
|
||||
) -> str:
|
||||
return super( # pylint: disable=bad-super-call
|
||||
PrestoEngineSpec, cls
|
||||
|
||||
Reference in New Issue
Block a user