You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2022/06/29 12:26:20 UTC
[superset] branch 2.0 updated: fix: Removes psycopg2 as a required dependency (#20543)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/2.0 by this push:
new 80e2f1abe7 fix: Removes psycopg2 as a required dependency (#20543)
80e2f1abe7 is described below
commit 80e2f1abe7d815eda315bbb76ee626f47e143779
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Wed Jun 29 09:22:13 2022 -0300
fix: Removes psycopg2 as a required dependency (#20543)
* fix: Removes psycopg2 as a required dependency
* Disables lint warning
(cherry picked from commit cb3cd41dcd33af37b06e8ffc4d6d7ae1166d2d7f)
---
superset/db_engine_specs/postgres.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/superset/db_engine_specs/postgres.py b/superset/db_engine_specs/postgres.py
index c5ffc79ee7..f9d450a3e9 100644
--- a/superset/db_engine_specs/postgres.py
+++ b/superset/db_engine_specs/postgres.py
@@ -21,7 +21,6 @@ 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
@@ -290,6 +289,9 @@ class PostgresEngineSpec(PostgresBaseEngineSpec, BasicParametersMixin):
@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: