Skip to content

Commit

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

* Disables lint warning
  • Loading branch information
michael-s-molina committed Jun 29, 2022
1 parent 4eb2a6f commit cb3cd41
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 cb3cd41

Please sign in to comment.