sqlalchemy-iris 0.14.0__tar.gz → 0.14.1b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlalchemy_iris-0.14.0/sqlalchemy_iris.egg-info → sqlalchemy_iris-0.14.1b1}/PKG-INFO +1 -1
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/setup.cfg +1 -1
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/base.py +3 -2
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/types.py +62 -55
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1/sqlalchemy_iris.egg-info}/PKG-INFO +1 -1
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/tests/test_suite.py +155 -147
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/LICENSE +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/README.md +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_BufferReader.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_BufferWriter.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_ConnectionInformation.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_ConnectionParameters.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_Constant.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_DBList.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_Device.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_GatewayContext.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_GatewayException.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_GatewayUtility.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRIS.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISConnection.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISEmbedded.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISGlobalNode.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISGlobalNodeView.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISIterator.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISList.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISNative.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISOREF.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISObject.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISReference.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_InStream.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_LegacyIterator.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_ListItem.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_ListReader.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_ListWriter.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_LogFileStream.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_MessageHeader.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_OutStream.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_PrintStream.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_PythonGateway.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_SharedMemorySocket.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/__init__.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/__main__.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_Column.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_DBAPI.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_Descriptor.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_IRISStream.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_Message.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_Parameter.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_ParameterCollection.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_ResultSetRow.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_SQLType.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/__init__.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/_PreParser.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/_Scanner.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/_Token.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/_TokenList.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/__init__.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_BusinessHost.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_BusinessOperation.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_BusinessProcess.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_BusinessService.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_Common.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_Director.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_IRISBusinessOperation.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_IRISBusinessService.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_IRISInboundAdapter.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_IRISOutboundAdapter.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_InboundAdapter.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_Message.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_OutboundAdapter.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/__init__.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/iris/__init__.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/iris/__init__.pyi +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/iris/iris_ipm.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/iris/iris_ipm.pyi +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/irisnative/_IRISNative.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/irisnative/__init__.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/setup.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/__init__.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/alembic.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/embedded.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/information_schema.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/iris.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/irisasync.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/provision.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris/requirements.py +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris.egg-info/SOURCES.txt +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris.egg-info/dependency_links.txt +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris.egg-info/entry_points.txt +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris.egg-info/requires.txt +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris.egg-info/top_level.txt +0 -0
- {sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/tests/test_alembic.py +0 -0
@@ -91,7 +91,6 @@ from .types import IRISTime
|
|
91
91
|
from .types import IRISTimeStamp
|
92
92
|
from .types import IRISDate
|
93
93
|
from .types import IRISDateTime
|
94
|
-
from .types import IRISUniqueIdentifier
|
95
94
|
from .types import IRISListBuild # noqa
|
96
95
|
from .types import IRISVector # noqa
|
97
96
|
|
@@ -819,8 +818,10 @@ colspecs = {
|
|
819
818
|
sqltypes.DateTime: IRISDateTime,
|
820
819
|
sqltypes.TIMESTAMP: IRISTimeStamp,
|
821
820
|
sqltypes.Time: IRISTime,
|
822
|
-
sqltypes.UUID: IRISUniqueIdentifier,
|
823
821
|
}
|
822
|
+
if sqlalchemy_version.startswith("2."):
|
823
|
+
from .types import IRISUniqueIdentifier
|
824
|
+
colspecs[sqltypes.UUID] = IRISUniqueIdentifier
|
824
825
|
|
825
826
|
|
826
827
|
class IRISExact(ReturnTypeFromArgs):
|
@@ -2,9 +2,10 @@ import datetime
|
|
2
2
|
from decimal import Decimal
|
3
3
|
from sqlalchemy import func, text
|
4
4
|
from sqlalchemy.sql import sqltypes
|
5
|
-
from sqlalchemy.types import UserDefinedType
|
5
|
+
from sqlalchemy.types import UserDefinedType
|
6
6
|
from uuid import UUID as _python_UUID
|
7
7
|
from intersystems_iris import IRISList
|
8
|
+
from sqlalchemy import __version__ as sqlalchemy_version
|
8
9
|
|
9
10
|
HOROLOG_ORDINAL = datetime.date(1840, 12, 31).toordinal()
|
10
11
|
|
@@ -134,73 +135,79 @@ class IRISTime(sqltypes.DateTime):
|
|
134
135
|
return process
|
135
136
|
|
136
137
|
|
137
|
-
|
138
|
-
def literal_processor(self, dialect):
|
139
|
-
if not self.as_uuid:
|
138
|
+
if sqlalchemy_version.startswith("2."):
|
140
139
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
return process
|
145
|
-
else:
|
146
|
-
|
147
|
-
def process(value):
|
148
|
-
return f"""'{str(value).replace("'", "''")}'"""
|
149
|
-
|
150
|
-
return process
|
151
|
-
|
152
|
-
def bind_processor(self, dialect):
|
153
|
-
character_based_uuid = not dialect.supports_native_uuid or not self.native_uuid
|
154
|
-
|
155
|
-
if character_based_uuid:
|
156
|
-
if self.as_uuid:
|
140
|
+
class IRISUniqueIdentifier(sqltypes.Uuid):
|
141
|
+
def literal_processor(self, dialect):
|
142
|
+
if not self.as_uuid:
|
157
143
|
|
158
144
|
def process(value):
|
159
|
-
|
160
|
-
value = str(value)
|
161
|
-
return value
|
145
|
+
return f"""'{value.replace("'", "''")}'"""
|
162
146
|
|
163
147
|
return process
|
164
148
|
else:
|
165
149
|
|
166
150
|
def process(value):
|
167
|
-
return value
|
151
|
+
return f"""'{str(value).replace("'", "''")}'"""
|
168
152
|
|
169
153
|
return process
|
170
|
-
else:
|
171
|
-
return None
|
172
154
|
|
173
|
-
|
174
|
-
|
155
|
+
def bind_processor(self, dialect):
|
156
|
+
character_based_uuid = (
|
157
|
+
not dialect.supports_native_uuid or not self.native_uuid
|
158
|
+
)
|
175
159
|
|
176
|
-
|
177
|
-
|
160
|
+
if character_based_uuid:
|
161
|
+
if self.as_uuid:
|
178
162
|
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
163
|
+
def process(value):
|
164
|
+
if value is not None:
|
165
|
+
value = str(value)
|
166
|
+
return value
|
183
167
|
|
184
|
-
|
168
|
+
return process
|
169
|
+
else:
|
170
|
+
|
171
|
+
def process(value):
|
172
|
+
return value
|
173
|
+
|
174
|
+
return process
|
185
175
|
else:
|
176
|
+
return None
|
186
177
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
178
|
+
def result_processor(self, dialect, coltype):
|
179
|
+
character_based_uuid = (
|
180
|
+
not dialect.supports_native_uuid or not self.native_uuid
|
181
|
+
)
|
191
182
|
|
192
|
-
|
193
|
-
|
194
|
-
if not self.as_uuid:
|
183
|
+
if character_based_uuid:
|
184
|
+
if self.as_uuid:
|
195
185
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
186
|
+
def process(value):
|
187
|
+
if value and not isinstance(value, _python_UUID):
|
188
|
+
value = _python_UUID(value)
|
189
|
+
return value
|
200
190
|
|
201
|
-
|
191
|
+
return process
|
192
|
+
else:
|
193
|
+
|
194
|
+
def process(value):
|
195
|
+
if value and isinstance(value, _python_UUID):
|
196
|
+
value = str(value)
|
197
|
+
return value
|
198
|
+
|
199
|
+
return process
|
202
200
|
else:
|
203
|
-
|
201
|
+
if not self.as_uuid:
|
202
|
+
|
203
|
+
def process(value):
|
204
|
+
if value and isinstance(value, _python_UUID):
|
205
|
+
value = str(value)
|
206
|
+
return value
|
207
|
+
|
208
|
+
return process
|
209
|
+
else:
|
210
|
+
return None
|
204
211
|
|
205
212
|
|
206
213
|
class IRISListBuild(UserDefinedType):
|
@@ -267,9 +274,7 @@ class IRISVector(UserDefinedType):
|
|
267
274
|
item_type_server = (
|
268
275
|
"decimal"
|
269
276
|
if self.item_type is float
|
270
|
-
else "float"
|
271
|
-
if self.item_type is Decimal
|
272
|
-
else "int"
|
277
|
+
else "float" if self.item_type is Decimal else "int"
|
273
278
|
)
|
274
279
|
self.item_type_server = item_type_server
|
275
280
|
|
@@ -304,19 +309,21 @@ class IRISVector(UserDefinedType):
|
|
304
309
|
# return self.func('vector_l2', other)
|
305
310
|
|
306
311
|
def max_inner_product(self, other):
|
307
|
-
return self.func(
|
312
|
+
return self.func("vector_dot_product", other)
|
308
313
|
|
309
314
|
def cosine_distance(self, other):
|
310
|
-
return self.func(
|
315
|
+
return self.func("vector_cosine", other)
|
311
316
|
|
312
317
|
def cosine(self, other):
|
313
|
-
return
|
318
|
+
return 1 - self.func("vector_cosine", other)
|
314
319
|
|
315
320
|
def func(self, funcname: str, other):
|
316
321
|
if not isinstance(other, list) and not isinstance(other, tuple):
|
317
322
|
raise ValueError("expected list or tuple, got '%s'" % type(other))
|
318
323
|
othervalue = f"[{','.join([str(v) for v in other])}]"
|
319
|
-
return getattr(func, funcname)(
|
324
|
+
return getattr(func, funcname)(
|
325
|
+
self, func.to_vector(othervalue, text(self.type.item_type_server))
|
326
|
+
)
|
320
327
|
|
321
328
|
|
322
329
|
class BIT(sqltypes.TypeEngine):
|
@@ -4,9 +4,6 @@ from sqlalchemy.testing.suite import FetchLimitOffsetTest as _FetchLimitOffsetTe
|
|
4
4
|
from sqlalchemy.testing.suite import CompoundSelectTest as _CompoundSelectTest
|
5
5
|
from sqlalchemy.testing.suite import CTETest as _CTETest
|
6
6
|
from sqlalchemy.testing.suite import DifficultParametersTest as _DifficultParametersTest
|
7
|
-
from sqlalchemy.testing.suite import (
|
8
|
-
BizarroCharacterFKResolutionTest as _BizarroCharacterFKResolutionTest,
|
9
|
-
)
|
10
7
|
from sqlalchemy.testing import fixtures
|
11
8
|
from sqlalchemy.testing.assertions import eq_
|
12
9
|
from sqlalchemy.testing import config
|
@@ -26,6 +23,8 @@ import pytest
|
|
26
23
|
|
27
24
|
from sqlalchemy.testing.suite import * # noqa
|
28
25
|
|
26
|
+
from sqlalchemy import __version__ as sqlalchemy_version
|
27
|
+
|
29
28
|
|
30
29
|
class CompoundSelectTest(_CompoundSelectTest):
|
31
30
|
@pytest.mark.skip()
|
@@ -270,166 +269,175 @@ class IRISEnumTest(fixtures.TablesTest):
|
|
270
269
|
)
|
271
270
|
|
272
271
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
)
|
277
|
-
@testing.variation("use_composite", [True, False])
|
278
|
-
@testing.combinations(
|
279
|
-
("plain",),
|
280
|
-
# ("(2)",), not in IRIS
|
281
|
-
("per % cent",),
|
282
|
-
("[brackets]",),
|
283
|
-
argnames="tablename",
|
272
|
+
if sqlalchemy_version.startswith("2."):
|
273
|
+
from sqlalchemy.testing.suite import (
|
274
|
+
BizarroCharacterFKResolutionTest as _BizarroCharacterFKResolutionTest,
|
284
275
|
)
|
285
|
-
def test_fk_ref(self, connection, metadata, use_composite, tablename, columnname):
|
286
|
-
super().test_fk_ref(connection, metadata, use_composite, tablename, columnname)
|
287
|
-
|
288
276
|
|
289
|
-
class
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
"
|
296
|
-
|
297
|
-
|
277
|
+
class BizarroCharacterFKResolutionTest(_BizarroCharacterFKResolutionTest):
|
278
|
+
@testing.combinations(
|
279
|
+
("id",), ("(3)",), ("col%p",), ("[brack]",), argnames="columnname"
|
280
|
+
)
|
281
|
+
@testing.variation("use_composite", [True, False])
|
282
|
+
@testing.combinations(
|
283
|
+
("plain",),
|
284
|
+
# ("(2)",), not in IRIS
|
285
|
+
("per % cent",),
|
286
|
+
("[brackets]",),
|
287
|
+
argnames="tablename",
|
298
288
|
)
|
289
|
+
def test_fk_ref(
|
290
|
+
self, connection, metadata, use_composite, tablename, columnname
|
291
|
+
):
|
292
|
+
super().test_fk_ref(
|
293
|
+
connection, metadata, use_composite, tablename, columnname
|
294
|
+
)
|
299
295
|
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
(
|
296
|
+
class IRISListBuildTest(fixtures.TablesTest):
|
297
|
+
__backend__ = True
|
298
|
+
|
299
|
+
@classmethod
|
300
|
+
def define_tables(cls, metadata):
|
301
|
+
Table(
|
302
|
+
"data",
|
303
|
+
metadata,
|
304
|
+
Column("val", IRISListBuild(10, float)),
|
309
305
|
)
|
310
|
-
)
|
311
306
|
|
312
|
-
|
313
|
-
|
314
|
-
|
307
|
+
@classmethod
|
308
|
+
def fixtures(cls):
|
309
|
+
return dict(
|
310
|
+
data=(
|
311
|
+
("val",),
|
312
|
+
([1.0] * 50,),
|
313
|
+
([1.23] * 50,),
|
314
|
+
([i for i in range(0, 50)],),
|
315
|
+
(None,),
|
316
|
+
)
|
317
|
+
)
|
315
318
|
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
[
|
320
|
-
([1.0] * 50,),
|
321
|
-
([1.23] * 50,),
|
322
|
-
([i for i in range(0, 50)],),
|
323
|
-
(None,),
|
324
|
-
],
|
325
|
-
)
|
326
|
-
self._assert_result(
|
327
|
-
select(self.tables.data).where(self.tables.data.c.val == [1.0] * 50),
|
328
|
-
[
|
329
|
-
([1.0] * 50,),
|
330
|
-
],
|
331
|
-
)
|
319
|
+
def _assert_result(self, select, result):
|
320
|
+
with config.db.connect() as conn:
|
321
|
+
eq_(conn.execute(select).fetchall(), result)
|
332
322
|
|
333
|
-
self
|
334
|
-
|
335
|
-
self.tables.data,
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
323
|
+
def test_listbuild(self):
|
324
|
+
self._assert_result(
|
325
|
+
select(self.tables.data),
|
326
|
+
[
|
327
|
+
([1.0] * 50,),
|
328
|
+
([1.23] * 50,),
|
329
|
+
([i for i in range(0, 50)],),
|
330
|
+
(None,),
|
331
|
+
],
|
332
|
+
)
|
333
|
+
self._assert_result(
|
334
|
+
select(self.tables.data).where(self.tables.data.c.val == [1.0] * 50),
|
335
|
+
[
|
336
|
+
([1.0] * 50,),
|
337
|
+
],
|
338
|
+
)
|
342
339
|
|
340
|
+
self._assert_result(
|
341
|
+
select(
|
342
|
+
self.tables.data,
|
343
|
+
self.tables.data.c.val.func("$listsame", [1.0] * 50).label("same"),
|
344
|
+
).limit(1),
|
345
|
+
[
|
346
|
+
([1.0] * 50, 1),
|
347
|
+
],
|
348
|
+
)
|
343
349
|
|
344
|
-
class IRISVectorTest(fixtures.TablesTest):
|
345
|
-
|
350
|
+
class IRISVectorTest(fixtures.TablesTest):
|
351
|
+
__backend__ = True
|
346
352
|
|
347
|
-
|
353
|
+
__requires__ = ("iris_vector",)
|
348
354
|
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
355
|
+
@classmethod
|
356
|
+
def define_tables(cls, metadata):
|
357
|
+
Table(
|
358
|
+
"data",
|
359
|
+
metadata,
|
360
|
+
Column("id", INTEGER),
|
361
|
+
Column("emb", IRISVector(3, float)),
|
362
|
+
)
|
357
363
|
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
364
|
+
@classmethod
|
365
|
+
def fixtures(cls):
|
366
|
+
return dict(
|
367
|
+
data=(
|
368
|
+
(
|
369
|
+
"id",
|
370
|
+
"emb",
|
371
|
+
),
|
372
|
+
(
|
373
|
+
1,
|
374
|
+
[1, 1, 1],
|
375
|
+
),
|
376
|
+
(
|
377
|
+
2,
|
378
|
+
[2, 2, 2],
|
379
|
+
),
|
380
|
+
(
|
381
|
+
3,
|
382
|
+
[1, 1, 2],
|
383
|
+
),
|
384
|
+
)
|
378
385
|
)
|
379
|
-
)
|
380
386
|
|
381
|
-
|
382
|
-
|
383
|
-
|
387
|
+
def _assert_result(self, select, result):
|
388
|
+
with config.db.connect() as conn:
|
389
|
+
eq_(conn.execute(select).fetchall(), result)
|
384
390
|
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
391
|
+
def test_vector(self):
|
392
|
+
self._assert_result(
|
393
|
+
select(self.tables.data.c.emb),
|
394
|
+
[
|
395
|
+
([1, 1, 1],),
|
396
|
+
([2, 2, 2],),
|
397
|
+
([1, 1, 2],),
|
398
|
+
],
|
399
|
+
)
|
400
|
+
self._assert_result(
|
401
|
+
select(self.tables.data.c.id).where(
|
402
|
+
self.tables.data.c.emb == [2, 2, 2]
|
403
|
+
),
|
404
|
+
[
|
405
|
+
(2,),
|
406
|
+
],
|
407
|
+
)
|
400
408
|
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
409
|
+
def test_cosine(self):
|
410
|
+
self._assert_result(
|
411
|
+
select(
|
412
|
+
self.tables.data.c.id,
|
413
|
+
).order_by(self.tables.data.c.emb.cosine([1, 1, 1])),
|
414
|
+
[
|
415
|
+
(1,),
|
416
|
+
(2,),
|
417
|
+
(3,),
|
418
|
+
],
|
419
|
+
)
|
412
420
|
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
421
|
+
def test_cosine_distance(self):
|
422
|
+
self._assert_result(
|
423
|
+
select(
|
424
|
+
self.tables.data.c.id,
|
425
|
+
).order_by(1 - self.tables.data.c.emb.cosine_distance([1, 1, 1])),
|
426
|
+
[
|
427
|
+
(1,),
|
428
|
+
(2,),
|
429
|
+
(3,),
|
430
|
+
],
|
431
|
+
)
|
424
432
|
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
433
|
+
def test_max_inner_product(self):
|
434
|
+
self._assert_result(
|
435
|
+
select(
|
436
|
+
self.tables.data.c.id,
|
437
|
+
).order_by(self.tables.data.c.emb.max_inner_product([1, 1, 1])),
|
438
|
+
[
|
439
|
+
(1,),
|
440
|
+
(3,),
|
441
|
+
(2,),
|
442
|
+
],
|
443
|
+
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_ConnectionInformation.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_ConnectionParameters.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_IRISGlobalNodeView.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/_SharedMemorySocket.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_ParameterCollection.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/_ResultSetRow.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/_PreParser.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/_Scanner.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/_Token.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/_TokenList.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/dbapi/preparser/__init__.py
RENAMED
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_BusinessOperation.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_BusinessProcess.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_BusinessService.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_IRISBusinessOperation.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_IRISBusinessService.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_IRISInboundAdapter.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_IRISOutboundAdapter.py
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_InboundAdapter.py
RENAMED
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/intersystems_iris/pex/_OutboundAdapter.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris.egg-info/dependency_links.txt
RENAMED
File without changes
|
{sqlalchemy_iris-0.14.0 → sqlalchemy_iris-0.14.1b1}/sqlalchemy_iris.egg-info/entry_points.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|