mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: datatype tracking issue on virtual dataset (#20088)
* Fix datatype tracking issue on virtual dataset * fix pytest issue on postgresql
This commit is contained in:
@@ -21,6 +21,7 @@ from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Pattern, Tuple, TYPE_CHECKING
|
||||
|
||||
from flask_babel import gettext as __
|
||||
from psycopg2.extensions import binary_types, string_types
|
||||
from sqlalchemy.dialects.postgresql import ARRAY, DOUBLE_PRECISION, ENUM, JSON
|
||||
from sqlalchemy.dialects.postgresql.base import PGInspector
|
||||
from sqlalchemy.types import String
|
||||
@@ -287,6 +288,14 @@ class PostgresEngineSpec(PostgresBaseEngineSpec, BasicParametersMixin):
|
||||
native_type, column_type_mappings=column_type_mappings
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_datatype(cls, type_code: Any) -> Optional[str]:
|
||||
types = binary_types.copy()
|
||||
types.update(string_types)
|
||||
if type_code in types:
|
||||
return types[type_code].name
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def get_cancel_query_id(cls, cursor: Any, query: Query) -> Optional[str]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user