diff --git a/superset/db_engine_specs/postgres.py b/superset/db_engine_specs/postgres.py index b9217eb563a4..c2951c394d01 100644 --- a/superset/db_engine_specs/postgres.py +++ b/superset/db_engine_specs/postgres.py @@ -32,7 +32,6 @@ ) from flask_babel import gettext as __ -from pytz import _FixedOffset from sqlalchemy.dialects.postgresql import ARRAY, DOUBLE_PRECISION, ENUM, JSON from sqlalchemy.dialects.postgresql.base import PGInspector from sqlalchemy.types import String, TypeEngine @@ -50,12 +49,6 @@ logger = logging.getLogger() -# Replace psycopg2.tz.FixedOffsetTimezone with pytz, which is serializable by PyArrow -# https://github.com/stub42/pytz/blob/b70911542755aeeea7b5a9e066df5e1c87e8f2c8/src/pytz/reference.py#L25 -class FixedOffsetTimezone(_FixedOffset): - pass - - # Regular expressions to catch custom errors CONNECTION_INVALID_USERNAME_REGEX = re.compile( 'role "(?P.*?)" does not exist' @@ -168,7 +161,6 @@ class PostgresBaseEngineSpec(BaseEngineSpec): def fetch_data( cls, cursor: Any, limit: Optional[int] = None ) -> List[Tuple[Any, ...]]: - cursor.tzinfo_factory = FixedOffsetTimezone if not cursor.description: return [] return super().fetch_data(cursor, limit)