summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/array.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-04-11 10:26:38 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-04-11 10:49:30 -0400
commit1b463058e3282c73d0fb361f78e96ecaa23ce9f4 (patch)
tree3dc225d6233db6c15c57a5f6941229f92bb101d6 /lib/sqlalchemy/dialects/postgresql/array.py
parent5b81dbcfa3888de65fc33b247353b38488199b00 (diff)
downloadsqlalchemy-1b463058e3282c73d0fb361f78e96ecaa23ce9f4.tar.gz
Set up base ARRAY to be compatible with postgresql.ARRAY.
For some reason, when ARRAY was added to the base it was never linked to postgresql.ARRAY. Link the two types and also make base ARRAY the schema event target so that it supports the same features as postgresql.ARRAY. Change-Id: I82fa6c9d2b8c5028dba3a009715f7bc296b2bc0b Fixes: #3964
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/array.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/array.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/array.py b/lib/sqlalchemy/dialects/postgresql/array.py
index 98cab9562..009c83c0d 100644
--- a/lib/sqlalchemy/dialects/postgresql/array.py
+++ b/lib/sqlalchemy/dialects/postgresql/array.py
@@ -5,7 +5,7 @@
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-from .base import ischema_names
+from .base import ischema_names, colspecs
from ...sql import expression, operators
from ...sql.base import SchemaEventTarget
from ... import types as sqltypes
@@ -114,7 +114,7 @@ CONTAINED_BY = operators.custom_op("<@", precedence=5)
OVERLAP = operators.custom_op("&&", precedence=5)
-class ARRAY(SchemaEventTarget, sqltypes.ARRAY):
+class ARRAY(sqltypes.ARRAY):
"""PostgreSQL ARRAY type.
@@ -248,18 +248,6 @@ class ARRAY(SchemaEventTarget, sqltypes.ARRAY):
def compare_values(self, x, y):
return x == y
- def _set_parent(self, column):
- """Support SchemaEventTarget"""
-
- if isinstance(self.item_type, SchemaEventTarget):
- self.item_type._set_parent(column)
-
- def _set_parent_with_dispatch(self, parent):
- """Support SchemaEventTarget"""
-
- if isinstance(self.item_type, SchemaEventTarget):
- self.item_type._set_parent_with_dispatch(parent)
-
def _proc_array(self, arr, itemproc, dim, collection):
if dim is None:
arr = list(arr)
@@ -311,4 +299,5 @@ class ARRAY(SchemaEventTarget, sqltypes.ARRAY):
tuple if self.as_tuple else list)
return process
+colspecs[sqltypes.ARRAY] = ARRAY
ischema_names['_array'] = ARRAY