Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix: Removes psycopg2 as a required dependency (apache#20543)
Browse files Browse the repository at this point in the history
* fix: Removes psycopg2 as a required dependency

* Disables lint warning

(cherry picked from commit cb3cd41)
  • Loading branch information
michael-s-molina authored and John Bodley committed Jul 8, 2022
1 parent f6e7e93 commit 5a78f30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superset/db_engine_specs/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
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
Expand Down Expand Up @@ -290,6 +289,9 @@ def get_column_spec(

@classmethod
def get_datatype(cls, type_code: Any) -> Optional[str]:
# pylint: disable=import-outside-toplevel
from psycopg2.extensions import binary_types, string_types

types = binary_types.copy()
types.update(string_types)
if type_code in types:
Expand Down

0 comments on commit 5a78f30

Please sign in to comment.