From: Federico Caselli Date: Mon, 29 Jan 2024 19:09:56 +0000 (+0100) Subject: Export array module from postgresql X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47716f5a45eb91361a5fdabb420144a1807ca8ae;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Export array module from postgresql Before this module was shadowed by same named array classe. Change-Id: I6fc56795c9363a9a07466fd36fcd49d0fb9658f7 --- diff --git a/lib/sqlalchemy/dialects/postgresql/__init__.py b/lib/sqlalchemy/dialects/postgresql/__init__.py index f85c1e990d..8dfa54d3ac 100644 --- a/lib/sqlalchemy/dialects/postgresql/__init__.py +++ b/lib/sqlalchemy/dialects/postgresql/__init__.py @@ -8,6 +8,7 @@ from types import ModuleType +from . import array as arraylib # noqa # must be above base and other dialects from . import asyncpg # noqa from . import base from . import pg8000 # noqa @@ -86,6 +87,7 @@ from .types import TIMESTAMP from .types import TSQUERY from .types import TSVECTOR + # Alias psycopg also as psycopg_async psycopg_async = type( "psycopg_async", (ModuleType,), {"dialect": psycopg.dialect_async} diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index ef70000c1b..f5297ec25d 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1419,13 +1419,13 @@ from typing import TYPE_CHECKING from typing import TypedDict from typing import Union -from . import array as _array -from . import hstore as _hstore +from . import arraylib as _array from . import json as _json from . import pg_catalog from . import ranges as _ranges from .ext import _regconfig_fn from .ext import aggregate_order_by +from .hstore import HSTORE from .named_types import CreateDomainType as CreateDomainType # noqa: F401 from .named_types import CreateEnumType as CreateEnumType # noqa: F401 from .named_types import DOMAIN as DOMAIN # noqa: F401 @@ -1614,7 +1614,7 @@ colspecs = { ischema_names = { "_array": _array.ARRAY, - "hstore": _hstore.HSTORE, + "hstore": HSTORE, "json": _json.JSON, "jsonb": _json.JSONB, "int4range": _ranges.INT4RANGE,