singlestoredb 1.1.0__cp38-abi3-win_amd64.whl → 1.3.0__cp38-abi3-win_amd64.whl
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.
Potentially problematic release.
This version of singlestoredb might be problematic. Click here for more details.
- _singlestoredb_accel.pyd +0 -0
- singlestoredb/__init__.py +1 -1
- singlestoredb/config.py +6 -0
- singlestoredb/connection.py +23 -1
- singlestoredb/converters.py +390 -0
- singlestoredb/functions/ext/asgi.py +7 -1
- singlestoredb/fusion/handler.py +14 -8
- singlestoredb/fusion/handlers/stage.py +167 -84
- singlestoredb/fusion/handlers/workspace.py +250 -108
- singlestoredb/fusion/registry.py +27 -10
- singlestoredb/http/connection.py +18 -1
- singlestoredb/management/__init__.py +1 -0
- singlestoredb/management/organization.py +4 -0
- singlestoredb/management/utils.py +2 -2
- singlestoredb/management/workspace.py +79 -6
- singlestoredb/mysql/connection.py +92 -16
- singlestoredb/mysql/constants/EXTENDED_TYPE.py +3 -0
- singlestoredb/mysql/constants/FIELD_TYPE.py +16 -0
- singlestoredb/mysql/constants/VECTOR_TYPE.py +6 -0
- singlestoredb/mysql/cursors.py +13 -10
- singlestoredb/mysql/protocol.py +50 -1
- singlestoredb/notebook/__init__.py +15 -0
- singlestoredb/notebook/_objects.py +212 -0
- singlestoredb/tests/test.sql +49 -0
- singlestoredb/tests/test_connection.py +174 -0
- singlestoredb/utils/results.py +5 -1
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/METADATA +1 -1
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/RECORD +32 -28
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/LICENSE +0 -0
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/WHEEL +0 -0
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/entry_points.txt +0 -0
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
import functools
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from ..management import workspace as _ws
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Secrets(object):
|
|
9
|
+
"""Wrapper for accessing secrets as object attributes."""
|
|
10
|
+
|
|
11
|
+
def __getattr__(self, name: str) -> str:
|
|
12
|
+
if name.startswith('_ipython') or name.startswith('_repr_'):
|
|
13
|
+
raise AttributeError(name)
|
|
14
|
+
return _ws.get_secret(name)
|
|
15
|
+
|
|
16
|
+
def __getitem__(self, name: str) -> str:
|
|
17
|
+
return _ws.get_secret(name)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Stage(object):
|
|
21
|
+
|
|
22
|
+
def __new__(cls, *args: Any, **kwargs: Any) -> Any:
|
|
23
|
+
# We are remapping the methods and attributes here so that
|
|
24
|
+
# autocomplete still works in Jupyter / IPython, but we
|
|
25
|
+
# bypass the real method / attribute calls and apply them
|
|
26
|
+
# to the currently selected stage.
|
|
27
|
+
for name in [x for x in dir(_ws.Stage) if not x.startswith('_')]:
|
|
28
|
+
if name in ['from_dict', 'refresh', 'update']:
|
|
29
|
+
continue
|
|
30
|
+
attr = getattr(_ws.Stage, name)
|
|
31
|
+
|
|
32
|
+
def make_wrapper(m: str, is_method: bool = False) -> Any:
|
|
33
|
+
if is_method:
|
|
34
|
+
def wrap(self: Stage, *a: Any, **kw: Any) -> Any:
|
|
35
|
+
return getattr(_ws.get_stage(), m)(*a, **kw)
|
|
36
|
+
return functools.update_wrapper(wrap, attr)
|
|
37
|
+
else:
|
|
38
|
+
def wrap(self: Stage, *a: Any, **kw: Any) -> Any:
|
|
39
|
+
return getattr(_ws.get_stage(), m)
|
|
40
|
+
return property(functools.update_wrapper(wrap, attr))
|
|
41
|
+
|
|
42
|
+
setattr(cls, name, make_wrapper(m=name, is_method=callable(attr)))
|
|
43
|
+
|
|
44
|
+
for name in [
|
|
45
|
+
x for x in _ws.Stage.__annotations__.keys()
|
|
46
|
+
if not x.startswith('_')
|
|
47
|
+
]:
|
|
48
|
+
|
|
49
|
+
def make_wrapper(m: str, is_method: bool = False) -> Any:
|
|
50
|
+
def wrap(self: Stage) -> Any:
|
|
51
|
+
return getattr(_ws.get_stage(), m)
|
|
52
|
+
return property(functools.update_wrapper(wrap, attr))
|
|
53
|
+
|
|
54
|
+
setattr(cls, name, make_wrapper(m=name))
|
|
55
|
+
|
|
56
|
+
cls.__doc__ = _ws.Stage.__doc__
|
|
57
|
+
|
|
58
|
+
return super().__new__(cls, *args, **kwargs)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class WorkspaceGroup(object):
|
|
62
|
+
|
|
63
|
+
def __new__(cls, *args: Any, **kwargs: Any) -> Any:
|
|
64
|
+
# We are remapping the methods and attributes here so that
|
|
65
|
+
# autocomplete still works in Jupyter / IPython, but we
|
|
66
|
+
# bypass the real method / attribute calls and apply them
|
|
67
|
+
# to the currently selected workspace group.
|
|
68
|
+
for name in [x for x in dir(_ws.WorkspaceGroup) if not x.startswith('_')]:
|
|
69
|
+
if name in ['from_dict', 'refresh', 'update']:
|
|
70
|
+
continue
|
|
71
|
+
|
|
72
|
+
attr = getattr(_ws.WorkspaceGroup, name)
|
|
73
|
+
|
|
74
|
+
def make_wrapper(m: str, is_method: bool = False) -> Any:
|
|
75
|
+
if is_method:
|
|
76
|
+
def wrap(self: WorkspaceGroup, *a: Any, **kw: Any) -> Any:
|
|
77
|
+
return getattr(_ws.get_workspace_group(), m)(*a, **kw)
|
|
78
|
+
return functools.update_wrapper(wrap, attr)
|
|
79
|
+
else:
|
|
80
|
+
def wrap(self: WorkspaceGroup, *a: Any, **kw: Any) -> Any:
|
|
81
|
+
return getattr(_ws.get_workspace_group(), m)
|
|
82
|
+
return property(functools.update_wrapper(wrap, attr))
|
|
83
|
+
|
|
84
|
+
setattr(cls, name, make_wrapper(m=name, is_method=callable(attr)))
|
|
85
|
+
|
|
86
|
+
for name in [
|
|
87
|
+
x for x in _ws.WorkspaceGroup.__annotations__.keys()
|
|
88
|
+
if not x.startswith('_')
|
|
89
|
+
]:
|
|
90
|
+
|
|
91
|
+
def make_wrapper(m: str, is_method: bool = False) -> Any:
|
|
92
|
+
def wrap(self: WorkspaceGroup) -> Any:
|
|
93
|
+
return getattr(_ws.get_workspace_group(), m)
|
|
94
|
+
return property(functools.update_wrapper(wrap, attr))
|
|
95
|
+
|
|
96
|
+
setattr(cls, name, make_wrapper(m=name))
|
|
97
|
+
|
|
98
|
+
cls.__doc__ = _ws.WorkspaceGroup.__doc__
|
|
99
|
+
|
|
100
|
+
return super().__new__(cls, *args, **kwargs)
|
|
101
|
+
|
|
102
|
+
def __str__(self) -> str:
|
|
103
|
+
return _ws.get_workspace_group().__str__()
|
|
104
|
+
|
|
105
|
+
def __repr__(self) -> str:
|
|
106
|
+
return _ws.get_workspace_group().__repr__()
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class Workspace(object):
|
|
110
|
+
|
|
111
|
+
def __new__(cls, *args: Any, **kwargs: Any) -> Any:
|
|
112
|
+
# We are remapping the methods and attributes here so that
|
|
113
|
+
# autocomplete still works in Jupyter / IPython, but we
|
|
114
|
+
# bypass the real method / attribute calls and apply them
|
|
115
|
+
# to the currently selected workspace.
|
|
116
|
+
for name in [x for x in dir(_ws.Workspace) if not x.startswith('_')]:
|
|
117
|
+
if name in ['from_dict', 'refresh', 'update']:
|
|
118
|
+
continue
|
|
119
|
+
|
|
120
|
+
attr = getattr(_ws.Workspace, name)
|
|
121
|
+
|
|
122
|
+
def make_wrapper(m: str, is_method: bool = False) -> Any:
|
|
123
|
+
if is_method:
|
|
124
|
+
def wrap(self: Workspace, *a: Any, **kw: Any) -> Any:
|
|
125
|
+
return getattr(_ws.get_workspace(), m)(*a, **kw)
|
|
126
|
+
return functools.update_wrapper(wrap, attr)
|
|
127
|
+
else:
|
|
128
|
+
def wrap(self: Workspace, *a: Any, **kw: Any) -> Any:
|
|
129
|
+
return getattr(_ws.get_workspace(), m)
|
|
130
|
+
return property(functools.update_wrapper(wrap, attr))
|
|
131
|
+
|
|
132
|
+
setattr(cls, name, make_wrapper(m=name, is_method=callable(attr)))
|
|
133
|
+
|
|
134
|
+
for name in [
|
|
135
|
+
x for x in _ws.Workspace.__annotations__.keys()
|
|
136
|
+
if not x.startswith('_')
|
|
137
|
+
]:
|
|
138
|
+
|
|
139
|
+
def make_wrapper(m: str, is_method: bool = False) -> Any:
|
|
140
|
+
def wrap(self: Workspace) -> Any:
|
|
141
|
+
return getattr(_ws.get_workspace(), m)
|
|
142
|
+
return property(functools.update_wrapper(wrap, attr))
|
|
143
|
+
|
|
144
|
+
setattr(cls, name, make_wrapper(m=name))
|
|
145
|
+
|
|
146
|
+
cls.__doc__ = _ws.Workspace.__doc__
|
|
147
|
+
|
|
148
|
+
return super().__new__(cls, *args, **kwargs)
|
|
149
|
+
|
|
150
|
+
def __str__(self) -> str:
|
|
151
|
+
return _ws.get_workspace().__str__()
|
|
152
|
+
|
|
153
|
+
def __repr__(self) -> str:
|
|
154
|
+
return _ws.get_workspace().__repr__()
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class Organization(object):
|
|
158
|
+
|
|
159
|
+
def __new__(cls, *args: Any, **kwargs: Any) -> Any:
|
|
160
|
+
# We are remapping the methods and attributes here so that
|
|
161
|
+
# autocomplete still works in Jupyter / IPython, but we
|
|
162
|
+
# bypass the real method / attribute calls and apply them
|
|
163
|
+
# to the currently selected organization.
|
|
164
|
+
for name in [x for x in dir(_ws.Organization) if not x.startswith('_')]:
|
|
165
|
+
if name in ['from_dict', 'refresh', 'update']:
|
|
166
|
+
continue
|
|
167
|
+
|
|
168
|
+
attr = getattr(_ws.Organization, name)
|
|
169
|
+
|
|
170
|
+
def make_wrapper(m: str, is_method: bool = False) -> Any:
|
|
171
|
+
if is_method:
|
|
172
|
+
def wrap(self: Organization, *a: Any, **kw: Any) -> Any:
|
|
173
|
+
return getattr(_ws.get_organization(), m)(*a, **kw)
|
|
174
|
+
return functools.update_wrapper(wrap, attr)
|
|
175
|
+
else:
|
|
176
|
+
def wrap(self: Organization, *a: Any, **kw: Any) -> Any:
|
|
177
|
+
return getattr(_ws.get_organization(), m)
|
|
178
|
+
return property(functools.update_wrapper(wrap, attr))
|
|
179
|
+
|
|
180
|
+
setattr(cls, name, make_wrapper(m=name, is_method=callable(attr)))
|
|
181
|
+
|
|
182
|
+
for name in [
|
|
183
|
+
x for x in _ws.Organization.__annotations__.keys()
|
|
184
|
+
if not x.startswith('_')
|
|
185
|
+
]:
|
|
186
|
+
|
|
187
|
+
def make_wrapper(m: str, is_method: bool = False) -> Any:
|
|
188
|
+
def wrap(self: Organization) -> Any:
|
|
189
|
+
return getattr(_ws.get_organization(), m)
|
|
190
|
+
return property(functools.update_wrapper(wrap, attr))
|
|
191
|
+
|
|
192
|
+
setattr(cls, name, make_wrapper(m=name))
|
|
193
|
+
|
|
194
|
+
cls.__doc__ = _ws.Organization.__doc__
|
|
195
|
+
|
|
196
|
+
return super().__new__(cls, *args, **kwargs)
|
|
197
|
+
|
|
198
|
+
def __str__(self) -> str:
|
|
199
|
+
return _ws.get_organization().__str__()
|
|
200
|
+
|
|
201
|
+
def __repr__(self) -> str:
|
|
202
|
+
return _ws.get_organization().__repr__()
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
secrets = Secrets()
|
|
206
|
+
stage = Stage()
|
|
207
|
+
organization = Organization()
|
|
208
|
+
workspace_group = WorkspaceGroup()
|
|
209
|
+
workspace = Workspace()
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
__all__ = ['secrets', 'stage', 'workspace', 'workspace_group', 'organization']
|
singlestoredb/tests/test.sql
CHANGED
|
@@ -606,4 +606,53 @@ INSERT INTO `badutf8` VALUES ('🥷🧙👻.eth');
|
|
|
606
606
|
INSERT INTO `badutf8` VALUES ('🥒rick.eth');
|
|
607
607
|
|
|
608
608
|
|
|
609
|
+
CREATE TABLE IF NOT EXISTS `f32_vectors` (
|
|
610
|
+
id INT(11),
|
|
611
|
+
a VECTOR(3)
|
|
612
|
+
);
|
|
613
|
+
INSERT INTO f32_vectors VALUES(1, '[0.267261237,0.534522474,0.801783681]');
|
|
614
|
+
INSERT INTO f32_vectors VALUES(2, '[0.371390671,0.557085991,0.742781341]');
|
|
615
|
+
INSERT INTO f32_vectors VALUES(3, '[-0.424264073,-0.565685451,0.707106829]');
|
|
616
|
+
|
|
617
|
+
CREATE TABLE IF NOT EXISTS `f64_vectors` (
|
|
618
|
+
id INT(11),
|
|
619
|
+
a VECTOR(3, F64)
|
|
620
|
+
);
|
|
621
|
+
INSERT INTO f64_vectors VALUES(1, '[0.267261237,0.534522474,0.801783681]');
|
|
622
|
+
INSERT INTO f64_vectors VALUES(2, '[0.371390671,0.557085991,0.742781341]');
|
|
623
|
+
INSERT INTO f64_vectors VALUES(3, '[-0.424264073,-0.565685451,0.707106829]');
|
|
624
|
+
|
|
625
|
+
CREATE TABLE `i8_vectors` (
|
|
626
|
+
id INT(11),
|
|
627
|
+
a VECTOR(3, I8)
|
|
628
|
+
);
|
|
629
|
+
INSERT INTO i8_vectors VALUES(1, '[1, 2, 3]');
|
|
630
|
+
INSERT INTO i8_vectors VALUES(2, '[4, 5, 6]');
|
|
631
|
+
INSERT INTO i8_vectors VALUES(3, '[-1, -4, 8]');
|
|
632
|
+
|
|
633
|
+
CREATE TABLE `i16_vectors` (
|
|
634
|
+
id INT(11),
|
|
635
|
+
a VECTOR(3, I16)
|
|
636
|
+
);
|
|
637
|
+
INSERT INTO i16_vectors VALUES(1, '[1, 2, 3]');
|
|
638
|
+
INSERT INTO i16_vectors VALUES(2, '[4, 5, 6]');
|
|
639
|
+
INSERT INTO i16_vectors VALUES(3, '[-1, -4, 8]');
|
|
640
|
+
|
|
641
|
+
CREATE TABLE `i32_vectors` (
|
|
642
|
+
id INT(11),
|
|
643
|
+
a VECTOR(3, I32)
|
|
644
|
+
);
|
|
645
|
+
INSERT INTO i32_vectors VALUES(1, '[1, 2, 3]');
|
|
646
|
+
INSERT INTO i32_vectors VALUES(2, '[4, 5, 6]');
|
|
647
|
+
INSERT INTO i32_vectors VALUES(3, '[-1, -4, 8]');
|
|
648
|
+
|
|
649
|
+
CREATE TABLE `i64_vectors` (
|
|
650
|
+
id INT(11),
|
|
651
|
+
a VECTOR(3, I64)
|
|
652
|
+
);
|
|
653
|
+
INSERT INTO i64_vectors VALUES(1, '[1, 2, 3]');
|
|
654
|
+
INSERT INTO i64_vectors VALUES(2, '[4, 5, 6]');
|
|
655
|
+
INSERT INTO i64_vectors VALUES(3, '[-1, -4, 8]');
|
|
656
|
+
|
|
657
|
+
|
|
609
658
|
COMMIT;
|
|
@@ -2876,6 +2876,180 @@ class TestConnection(unittest.TestCase):
|
|
|
2876
2876
|
|
|
2877
2877
|
# out = self.conn.show.create_view('vname')
|
|
2878
2878
|
|
|
2879
|
+
def test_f32_vectors(self):
|
|
2880
|
+
if self.conn.driver in ['http', 'https']:
|
|
2881
|
+
self.skipTest('Data API does not surface vector information')
|
|
2882
|
+
|
|
2883
|
+
self.cur.execute('show variables like "enable_extended_types_metadata"')
|
|
2884
|
+
out = list(self.cur)
|
|
2885
|
+
if not out or out[0][1].lower() == 'off':
|
|
2886
|
+
self.skipTest('Database engine does not support extended types metadata')
|
|
2887
|
+
|
|
2888
|
+
self.cur.execute('select a from f32_vectors order by id')
|
|
2889
|
+
out = list(self.cur)
|
|
2890
|
+
|
|
2891
|
+
assert out[0][0].dtype is np.dtype('float32')
|
|
2892
|
+
assert out[1][0].dtype is np.dtype('float32')
|
|
2893
|
+
assert out[2][0].dtype is np.dtype('float32')
|
|
2894
|
+
|
|
2895
|
+
np.testing.assert_array_equal(
|
|
2896
|
+
out[0][0],
|
|
2897
|
+
np.array([0.267261237, 0.534522474, 0.801783681], dtype=np.float32),
|
|
2898
|
+
)
|
|
2899
|
+
np.testing.assert_array_equal(
|
|
2900
|
+
out[1][0],
|
|
2901
|
+
np.array([0.371390671, 0.557085991, 0.742781341], dtype=np.float32),
|
|
2902
|
+
)
|
|
2903
|
+
np.testing.assert_array_equal(
|
|
2904
|
+
out[2][0],
|
|
2905
|
+
np.array([-0.424264073, -0.565685451, 0.707106829], dtype=np.float32),
|
|
2906
|
+
)
|
|
2907
|
+
|
|
2908
|
+
def test_f64_vectors(self):
|
|
2909
|
+
if self.conn.driver in ['http', 'https']:
|
|
2910
|
+
self.skipTest('Data API does not surface vector information')
|
|
2911
|
+
|
|
2912
|
+
self.cur.execute('show variables like "enable_extended_types_metadata"')
|
|
2913
|
+
out = list(self.cur)
|
|
2914
|
+
if not out or out[0][1].lower() == 'off':
|
|
2915
|
+
self.skipTest('Database engine does not support extended types metadata')
|
|
2916
|
+
|
|
2917
|
+
self.cur.execute('select a from f64_vectors order by id')
|
|
2918
|
+
out = list(self.cur)
|
|
2919
|
+
|
|
2920
|
+
assert out[0][0].dtype is np.dtype('float64')
|
|
2921
|
+
assert out[1][0].dtype is np.dtype('float64')
|
|
2922
|
+
assert out[2][0].dtype is np.dtype('float64')
|
|
2923
|
+
|
|
2924
|
+
np.testing.assert_array_equal(
|
|
2925
|
+
out[0][0],
|
|
2926
|
+
np.array([0.267261237, 0.534522474, 0.801783681], dtype=np.float64),
|
|
2927
|
+
)
|
|
2928
|
+
np.testing.assert_array_equal(
|
|
2929
|
+
out[1][0],
|
|
2930
|
+
np.array([0.371390671, 0.557085991, 0.742781341], dtype=np.float64),
|
|
2931
|
+
)
|
|
2932
|
+
np.testing.assert_array_equal(
|
|
2933
|
+
out[2][0],
|
|
2934
|
+
np.array([-0.424264073, -0.565685451, 0.707106829], dtype=np.float64),
|
|
2935
|
+
)
|
|
2936
|
+
|
|
2937
|
+
def test_i8_vectors(self):
|
|
2938
|
+
if self.conn.driver in ['http', 'https']:
|
|
2939
|
+
self.skipTest('Data API does not surface vector information')
|
|
2940
|
+
|
|
2941
|
+
self.cur.execute('show variables like "enable_extended_types_metadata"')
|
|
2942
|
+
out = list(self.cur)
|
|
2943
|
+
if not out or out[0][1].lower() == 'off':
|
|
2944
|
+
self.skipTest('Database engine does not support extended types metadata')
|
|
2945
|
+
|
|
2946
|
+
self.cur.execute('select a from i8_vectors order by id')
|
|
2947
|
+
out = list(self.cur)
|
|
2948
|
+
|
|
2949
|
+
assert out[0][0].dtype is np.dtype('int8')
|
|
2950
|
+
assert out[1][0].dtype is np.dtype('int8')
|
|
2951
|
+
assert out[2][0].dtype is np.dtype('int8')
|
|
2952
|
+
|
|
2953
|
+
np.testing.assert_array_equal(
|
|
2954
|
+
out[0][0],
|
|
2955
|
+
np.array([1, 2, 3], dtype=np.int8),
|
|
2956
|
+
)
|
|
2957
|
+
np.testing.assert_array_equal(
|
|
2958
|
+
out[1][0],
|
|
2959
|
+
np.array([4, 5, 6], dtype=np.int8),
|
|
2960
|
+
)
|
|
2961
|
+
np.testing.assert_array_equal(
|
|
2962
|
+
out[2][0],
|
|
2963
|
+
np.array([-1, -4, 8], dtype=np.int8),
|
|
2964
|
+
)
|
|
2965
|
+
|
|
2966
|
+
def test_i16_vectors(self):
|
|
2967
|
+
if self.conn.driver in ['http', 'https']:
|
|
2968
|
+
self.skipTest('Data API does not surface vector information')
|
|
2969
|
+
|
|
2970
|
+
self.cur.execute('show variables like "enable_extended_types_metadata"')
|
|
2971
|
+
out = list(self.cur)
|
|
2972
|
+
if not out or out[0][1].lower() == 'off':
|
|
2973
|
+
self.skipTest('Database engine does not support extended types metadata')
|
|
2974
|
+
|
|
2975
|
+
self.cur.execute('select a from i16_vectors order by id')
|
|
2976
|
+
out = list(self.cur)
|
|
2977
|
+
|
|
2978
|
+
assert out[0][0].dtype is np.dtype('int16')
|
|
2979
|
+
assert out[1][0].dtype is np.dtype('int16')
|
|
2980
|
+
assert out[2][0].dtype is np.dtype('int16')
|
|
2981
|
+
|
|
2982
|
+
np.testing.assert_array_equal(
|
|
2983
|
+
out[0][0],
|
|
2984
|
+
np.array([1, 2, 3], dtype=np.int16),
|
|
2985
|
+
)
|
|
2986
|
+
np.testing.assert_array_equal(
|
|
2987
|
+
out[1][0],
|
|
2988
|
+
np.array([4, 5, 6], dtype=np.int16),
|
|
2989
|
+
)
|
|
2990
|
+
np.testing.assert_array_equal(
|
|
2991
|
+
out[2][0],
|
|
2992
|
+
np.array([-1, -4, 8], dtype=np.int16),
|
|
2993
|
+
)
|
|
2994
|
+
|
|
2995
|
+
def test_i32_vectors(self):
|
|
2996
|
+
if self.conn.driver in ['http', 'https']:
|
|
2997
|
+
self.skipTest('Data API does not surface vector information')
|
|
2998
|
+
|
|
2999
|
+
self.cur.execute('show variables like "enable_extended_types_metadata"')
|
|
3000
|
+
out = list(self.cur)
|
|
3001
|
+
if not out or out[0][1].lower() == 'off':
|
|
3002
|
+
self.skipTest('Database engine does not support extended types metadata')
|
|
3003
|
+
|
|
3004
|
+
self.cur.execute('select a from i32_vectors order by id')
|
|
3005
|
+
out = list(self.cur)
|
|
3006
|
+
|
|
3007
|
+
assert out[0][0].dtype is np.dtype('int32')
|
|
3008
|
+
assert out[1][0].dtype is np.dtype('int32')
|
|
3009
|
+
assert out[2][0].dtype is np.dtype('int32')
|
|
3010
|
+
|
|
3011
|
+
np.testing.assert_array_equal(
|
|
3012
|
+
out[0][0],
|
|
3013
|
+
np.array([1, 2, 3], dtype=np.int32),
|
|
3014
|
+
)
|
|
3015
|
+
np.testing.assert_array_equal(
|
|
3016
|
+
out[1][0],
|
|
3017
|
+
np.array([4, 5, 6], dtype=np.int32),
|
|
3018
|
+
)
|
|
3019
|
+
np.testing.assert_array_equal(
|
|
3020
|
+
out[2][0],
|
|
3021
|
+
np.array([-1, -4, 8], dtype=np.int32),
|
|
3022
|
+
)
|
|
3023
|
+
|
|
3024
|
+
def test_i64_vectors(self):
|
|
3025
|
+
if self.conn.driver in ['http', 'https']:
|
|
3026
|
+
self.skipTest('Data API does not surface vector information')
|
|
3027
|
+
|
|
3028
|
+
self.cur.execute('show variables like "enable_extended_types_metadata"')
|
|
3029
|
+
out = list(self.cur)
|
|
3030
|
+
if not out or out[0][1].lower() == 'off':
|
|
3031
|
+
self.skipTest('Database engine does not support extended types metadata')
|
|
3032
|
+
|
|
3033
|
+
self.cur.execute('select a from i64_vectors order by id')
|
|
3034
|
+
out = list(self.cur)
|
|
3035
|
+
|
|
3036
|
+
assert out[0][0].dtype is np.dtype('int64')
|
|
3037
|
+
assert out[1][0].dtype is np.dtype('int64')
|
|
3038
|
+
assert out[2][0].dtype is np.dtype('int64')
|
|
3039
|
+
|
|
3040
|
+
np.testing.assert_array_equal(
|
|
3041
|
+
out[0][0],
|
|
3042
|
+
np.array([1, 2, 3], dtype=np.int64),
|
|
3043
|
+
)
|
|
3044
|
+
np.testing.assert_array_equal(
|
|
3045
|
+
out[1][0],
|
|
3046
|
+
np.array([4, 5, 6], dtype=np.int64),
|
|
3047
|
+
)
|
|
3048
|
+
np.testing.assert_array_equal(
|
|
3049
|
+
out[2][0],
|
|
3050
|
+
np.array([-1, -4, 8], dtype=np.int64),
|
|
3051
|
+
)
|
|
3052
|
+
|
|
2879
3053
|
|
|
2880
3054
|
if __name__ == '__main__':
|
|
2881
3055
|
import nose2
|
singlestoredb/utils/results.py
CHANGED
|
@@ -515,6 +515,8 @@ _schema_converters: Dict[
|
|
|
515
515
|
'namedtuples': _no_schema,
|
|
516
516
|
'dict': _no_schema,
|
|
517
517
|
'dicts': _no_schema,
|
|
518
|
+
'structsequence': _no_schema,
|
|
519
|
+
'structsequences': _no_schema,
|
|
518
520
|
'numpy': _description_to_numpy_schema,
|
|
519
521
|
'pandas': _description_to_numpy_schema,
|
|
520
522
|
'polars': _description_to_polars_schema,
|
|
@@ -578,4 +580,6 @@ def get_schema(
|
|
|
578
580
|
for the given format type
|
|
579
581
|
|
|
580
582
|
"""
|
|
581
|
-
|
|
583
|
+
if format in _schema_converters:
|
|
584
|
+
return _schema_converters[format](desc) or {}
|
|
585
|
+
return {}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
_singlestoredb_accel.pyd,sha256=
|
|
2
|
-
singlestoredb/__init__.py,sha256=
|
|
1
|
+
_singlestoredb_accel.pyd,sha256=u5N8fZtII5jhrswsZ2N0JRbwRJJgtYD_ci9SIMkvAAs,59392
|
|
2
|
+
singlestoredb/__init__.py,sha256=P-_L_CHfQOcteZO1mbDWyLUyDUfU5rFfOKIJfI1M0JU,1697
|
|
3
3
|
singlestoredb/auth.py,sha256=RmYiH0Wlc2RXc4pTlRMysxtBI445ggCIwojWKC_eDLE,7844
|
|
4
|
-
singlestoredb/config.py,sha256=
|
|
5
|
-
singlestoredb/connection.py,sha256=
|
|
6
|
-
singlestoredb/converters.py,sha256=
|
|
4
|
+
singlestoredb/config.py,sha256=9pVmVEZ23NfJ3pokdBDA0cX3bwUz6SbuT4AZWAcIPR4,12235
|
|
5
|
+
singlestoredb/connection.py,sha256=F8lTA62nwnQ_r9-WYANnbIBqacdAuX0wXGaET9PNkXA,46410
|
|
6
|
+
singlestoredb/converters.py,sha256=7_Of1f3Ow-JUoY1pHFlMPYxvt8llzdk-7X8qk5z2xJM,21631
|
|
7
7
|
singlestoredb/exceptions.py,sha256=WCCJrNSsU-hD-621Jpd6bwmvGftQ7byXkk-XKXlaxpg,3354
|
|
8
8
|
singlestoredb/pytest.py,sha256=TH364xRCN7_QaN0oRQDHixrEcDx_ZBgu3bmY0tvKrYU,9357
|
|
9
9
|
singlestoredb/types.py,sha256=Lv0BEQl6aSZBiAe0OSI07FEJhcHZ9HX45iT9NU_mxHQ,10334
|
|
@@ -14,47 +14,49 @@ singlestoredb/functions/dtypes.py,sha256=5IwMSaSzxtSowxXrm5hZXW1lpNm6QILxiU4mAUE
|
|
|
14
14
|
singlestoredb/functions/signature.py,sha256=glxf8wVhwpsLOu9s9UEXPaXzBWvl_XN683_dpFyiQ6s,19539
|
|
15
15
|
singlestoredb/functions/ext/__init__.py,sha256=5ppI8IZN_zOwoJFdu_Oq9ipxtyHw9n6OMVAa_s9T_yY,24
|
|
16
16
|
singlestoredb/functions/ext/arrow.py,sha256=mQhwaMpvCH_dP92WIhP_j-stu272n4UAHsFUOBTgnq0,9436
|
|
17
|
-
singlestoredb/functions/ext/asgi.py,sha256=
|
|
17
|
+
singlestoredb/functions/ext/asgi.py,sha256=mtCbZwcVS7lJLC3QRJvRNLpJjcyCrYA1Pb2PvMFDKyI,41267
|
|
18
18
|
singlestoredb/functions/ext/json.py,sha256=CROdj37cuJhAZ-CM93EI-SoLb4kxFcMGudsJ5QGyCoI,10831
|
|
19
19
|
singlestoredb/functions/ext/mmap.py,sha256=zo6eweOFCZp0KIzAeL1vvuSjqvQhE8ybVhHbU0ZICt4,14124
|
|
20
20
|
singlestoredb/functions/ext/rowdat_1.py,sha256=KYj_y5JWm3_B2-QC47HK-CNOrzujBqGUwLJfE49jwRg,23050
|
|
21
21
|
singlestoredb/functions/ext/utils.py,sha256=OPMFD-tTCx2Kk9jguQkrTr7e4AgNkt15YsvaT1YSmN8,5480
|
|
22
22
|
singlestoredb/fusion/__init__.py,sha256=FHWtrg6OJFTf6Ye197V5sU6ssryr2h6FBcDIgXP7-H4,367
|
|
23
23
|
singlestoredb/fusion/graphql.py,sha256=SHqsPe4xgawdsTPHEtJGQlybYGWqPrGMmyK-v20RLac,5420
|
|
24
|
-
singlestoredb/fusion/handler.py,sha256=
|
|
25
|
-
singlestoredb/fusion/registry.py,sha256=
|
|
24
|
+
singlestoredb/fusion/handler.py,sha256=PZXPWFhd3BaFtnpJqK2cFTw8oOaUVGIh1cS6BvltzKk,22308
|
|
25
|
+
singlestoredb/fusion/registry.py,sha256=_eT1gd38VPlFKs5f9Pu6lqQyoDQ_ixW5O56QwYLQ89Y,6361
|
|
26
26
|
singlestoredb/fusion/result.py,sha256=EcFY5Qv43ySlQsfl_JB-I3ko7PzVdjuhhoKN96uHSAM,12171
|
|
27
27
|
singlestoredb/fusion/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
-
singlestoredb/fusion/handlers/stage.py,sha256=
|
|
28
|
+
singlestoredb/fusion/handlers/stage.py,sha256=uPqawMvchnpyrPYLhB0joTremCURNYKOvYntFc3zTRU,14133
|
|
29
29
|
singlestoredb/fusion/handlers/utils.py,sha256=7xWb_1mJzxW0po9iHVY2ZVnRvHIQgOlKZQZ1zllJBjk,5271
|
|
30
|
-
singlestoredb/fusion/handlers/workspace.py,sha256=
|
|
30
|
+
singlestoredb/fusion/handlers/workspace.py,sha256=lzTaa55QfKuwuSCGbrlk4B_hPQ6xcjZ8oZFDz-Vznxo,25815
|
|
31
31
|
singlestoredb/http/__init__.py,sha256=4cEDvLloGc3LSpU-PnIwacyu0n5oIIIE6xk2SPyWD_w,939
|
|
32
|
-
singlestoredb/http/connection.py,sha256=
|
|
33
|
-
singlestoredb/management/__init__.py,sha256=
|
|
32
|
+
singlestoredb/http/connection.py,sha256=zIkVfemoXPPlCDEvms698icd5nf8X_pK1YorDVgLDvs,40596
|
|
33
|
+
singlestoredb/management/__init__.py,sha256=CjK47iU4WXJoq24EcXqBPCat4efAY20FR4qltWdxYf0,242
|
|
34
34
|
singlestoredb/management/billing_usage.py,sha256=0UHFSPCrN0nyeGFFM-HXS3NP8pYmYo2BCCahDEPXvzg,3883
|
|
35
35
|
singlestoredb/management/cluster.py,sha256=0GhpuSt_rcFz5f1hzcRHK911KWFewljlV4GFtckB8uM,14822
|
|
36
36
|
singlestoredb/management/manager.py,sha256=QpWgu9W9n_HqxDJ4lAAFN7n1fhLB_BYkPy0_9uhGJvY,9107
|
|
37
|
-
singlestoredb/management/organization.py,sha256=
|
|
37
|
+
singlestoredb/management/organization.py,sha256=4YvY_EJ_BCkKeFLSx_XTC-IYiMtWXQ3_SCK8Yx63Rjg,5166
|
|
38
38
|
singlestoredb/management/region.py,sha256=oGoLLS88dE1GmY7GCc0BV7X3f7bWwKQyeXOVBFmK9Pk,1678
|
|
39
|
-
singlestoredb/management/utils.py,sha256=
|
|
40
|
-
singlestoredb/management/workspace.py,sha256=
|
|
39
|
+
singlestoredb/management/utils.py,sha256=wVWeU7VKMqFs1SHSTXOHRPf-Egm4da6_cHraTfcLfaE,9511
|
|
40
|
+
singlestoredb/management/workspace.py,sha256=4AbHlFy_n5obA7mmrRTFM3_wirou2NhYD9bKp74iMr4,63568
|
|
41
41
|
singlestoredb/mysql/__init__.py,sha256=CbpwzNUJPAmKPpIobC0-ugBta_RgHCMq7X7N75QLReY,4669
|
|
42
42
|
singlestoredb/mysql/_auth.py,sha256=YaqqyvAHmeraBv3BM207rNveUVPM-mPnW20ts_ynVWg,8341
|
|
43
43
|
singlestoredb/mysql/charset.py,sha256=mnCdMpvdub1S2mm2PSk2j5JddgsWRjsVLtGx-y9TskE,10724
|
|
44
|
-
singlestoredb/mysql/connection.py,sha256=
|
|
44
|
+
singlestoredb/mysql/connection.py,sha256=bvf1JPYSAZFsZD9vxfj7giSTza2eYRvCgW-gK7E549U,72260
|
|
45
45
|
singlestoredb/mysql/converters.py,sha256=vebFFm6IrC0WgY-5Eh-esaPizY5cq3vDOUlEKGaYM-U,7771
|
|
46
|
-
singlestoredb/mysql/cursors.py,sha256=
|
|
46
|
+
singlestoredb/mysql/cursors.py,sha256=pkrP-1t8IhBJRnYpdM7Rdm-332nOq1RYTDJ_yg_q5HI,27682
|
|
47
47
|
singlestoredb/mysql/err.py,sha256=aDbmfq08gWVmfgIea735wSeiFdvYbB5wusgd3qTVq1s,2480
|
|
48
48
|
singlestoredb/mysql/optionfile.py,sha256=bz0cZp8tQZvab1iU7OT0yldHyaMVbvAcUJ3TSNwcmyI,675
|
|
49
|
-
singlestoredb/mysql/protocol.py,sha256=
|
|
49
|
+
singlestoredb/mysql/protocol.py,sha256=UzHcrv0Pgb1FNofuBTnSxpC9VDkgNbPEbBrRETstxAg,14888
|
|
50
50
|
singlestoredb/mysql/times.py,sha256=yJ3_hSnXnWMXl2OwXnx6hjX7PyilQ3bZHH9rIdL3OXQ,486
|
|
51
51
|
singlestoredb/mysql/constants/CLIENT.py,sha256=hAo5tQqhc1V7t7tdNd4s6TINwYoDHldyssfvfxNWWPQ,916
|
|
52
52
|
singlestoredb/mysql/constants/COMMAND.py,sha256=T81MAx6Vkxf5-86PTk2OtENoXtaFSlEckBzzwrI9uXQ,711
|
|
53
53
|
singlestoredb/mysql/constants/CR.py,sha256=qCE-3R28NHhkyVwhgwgxQK0XX_bZyGtTlvNa3UWaXv0,2383
|
|
54
54
|
singlestoredb/mysql/constants/ER.py,sha256=FuZGMUaHPJzXNxcEsQUfQNtVEMYzYUXRvPDJnVOxXyQ,12770
|
|
55
|
-
singlestoredb/mysql/constants/
|
|
55
|
+
singlestoredb/mysql/constants/EXTENDED_TYPE.py,sha256=_4JAN9iminAGahZCS1eyp97c7-FwT8aKZrrVH8EY-fE,32
|
|
56
|
+
singlestoredb/mysql/constants/FIELD_TYPE.py,sha256=RPFqMUtZ5PLznsWKQtKpNhDLL8yKqCdYsKh82vkrkPs,813
|
|
56
57
|
singlestoredb/mysql/constants/FLAG.py,sha256=CbdDkHclXsvS-NdAvrFhFzby4BAVpvq0tIPOszHAqgA,229
|
|
57
58
|
singlestoredb/mysql/constants/SERVER_STATUS.py,sha256=W4UYyw1AW0brlgywTBaE6cm6eGq6NBvHK8iCAh2mQhM,343
|
|
59
|
+
singlestoredb/mysql/constants/VECTOR_TYPE.py,sha256=04uxfUBCsGFRhsQNGOniBgqgMkbUoCJucWWpz9R-HW8,69
|
|
58
60
|
singlestoredb/mysql/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
61
|
singlestoredb/mysql/tests/__init__.py,sha256=uP8Ijkk-yQJ-hOBEgUYpZVC1qQQWo2uMrWlaKXfHMgs,1016
|
|
60
62
|
singlestoredb/mysql/tests/base.py,sha256=EvKhSuIrIsHovCwxM2KMdDanLZnzJShUcfTX2avhT6Y,4151
|
|
@@ -77,14 +79,16 @@ singlestoredb/mysql/tests/thirdparty/test_MySQLdb/dbapi20.py,sha256=QdUWytoSusLi
|
|
|
77
79
|
singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py,sha256=oZLSIyN4DmHFwazMh6TR_waHlk3oeXEwAZ3rqDxv9CA,3200
|
|
78
80
|
singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py,sha256=cN7ftSQIeoMh3npna9UUeNcBdzl6VYXU3Vo9jR-U-hY,8246
|
|
79
81
|
singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py,sha256=K4EnQCWI_4ShmCv6xHSBDo0B2HVbJvGGYHWygp2bBBk,2920
|
|
82
|
+
singlestoredb/notebook/__init__.py,sha256=AgSb4vTrco9yHS3oy0OQP-mA3iZgD0Famjzd732ters,506
|
|
83
|
+
singlestoredb/notebook/_objects.py,sha256=0olvnMRb2swunKRKZfBKdofkTHbi3TjgMtsWkdhcqLI,8207
|
|
80
84
|
singlestoredb/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
85
|
singlestoredb/tests/empty.sql,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
86
|
singlestoredb/tests/local_infile.csv,sha256=0fYxcZcTvcwS2McF4sktFsipRY1G-ClGmCRR1eCqdEQ,45
|
|
83
|
-
singlestoredb/tests/test.sql,sha256=
|
|
87
|
+
singlestoredb/tests/test.sql,sha256=winJzhZ2W52PcQ1j8X_NNIDRBmEa-xMAYrS_hoUtAP8,18337
|
|
84
88
|
singlestoredb/tests/test2.sql,sha256=CEM8_lX189iQU65G3Pod7lig6osfrveQyoDz6HC35YQ,38
|
|
85
89
|
singlestoredb/tests/test_basics.py,sha256=MrI0RMisxiLkJEfkuVBhfHd4nPdK-NnqISbeFr4rWlU,45383
|
|
86
90
|
singlestoredb/tests/test_config.py,sha256=Ad0PDmCnJMOyy9f7WTKiRasSR_3mYRByUlSb7k5ZySg,11502
|
|
87
|
-
singlestoredb/tests/test_connection.py,sha256=
|
|
91
|
+
singlestoredb/tests/test_connection.py,sha256=qKi2u8avKFrZDJeuo1nI3NwOSRrghCoIsvwkokQkTss,120461
|
|
88
92
|
singlestoredb/tests/test_dbapi.py,sha256=cNJoTEZvYG7ckcwT7xqlkJX-2TDEYGTDDU1Igucp48k,679
|
|
89
93
|
singlestoredb/tests/test_exceptions.py,sha256=vscMYmdOJr0JmkTAJrNI2w0Q96Nfugjkrt5_lYnw8i0,1176
|
|
90
94
|
singlestoredb/tests/test_ext_func.py,sha256=gQErR-wAN8BqLNG5U4pNbg4qkQEo6Re8Hd9_Ztqo1RM,38550
|
|
@@ -105,11 +109,11 @@ singlestoredb/utils/convert_rows.py,sha256=gkZeZazeJvimCYEQ1FdAC-AmMDwmFGCuP6mi6
|
|
|
105
109
|
singlestoredb/utils/debug.py,sha256=y7dnJeJGt3U_BWXz9pLt1qNQREpPtumYX_sk1DiqG6Y,362
|
|
106
110
|
singlestoredb/utils/dtypes.py,sha256=_P2fTX2Fgv9Bcl-2L6KivhWgLzyu91sDamxVnmG92Mw,6103
|
|
107
111
|
singlestoredb/utils/mogrify.py,sha256=gCcn99-vgsGVjTUV7RHJ6hH4vCNrsGB_Xo4z8kiSPDQ,4201
|
|
108
|
-
singlestoredb/utils/results.py,sha256=
|
|
112
|
+
singlestoredb/utils/results.py,sha256=wR70LhCqlobniZf52r67zYLBOKjWHQm68NAskdRQND8,15862
|
|
109
113
|
singlestoredb/utils/xdict.py,sha256=-wi1lSPTnY99fhVMBhPKJ8cCsQhNG4GMUfkEBDKYgCw,13321
|
|
110
|
-
singlestoredb-1.
|
|
111
|
-
singlestoredb-1.
|
|
112
|
-
singlestoredb-1.
|
|
113
|
-
singlestoredb-1.
|
|
114
|
-
singlestoredb-1.
|
|
115
|
-
singlestoredb-1.
|
|
114
|
+
singlestoredb-1.3.0.dist-info/LICENSE,sha256=Bojenzui8aPNjlF3w4ojguDP7sTf8vFV_9Gc2UAG1sg,11542
|
|
115
|
+
singlestoredb-1.3.0.dist-info/METADATA,sha256=qpvu-1Qn8cFUbBOPrD84XzIii6Y3lD-vAAS03s1wBmY,5710
|
|
116
|
+
singlestoredb-1.3.0.dist-info/WHEEL,sha256=UyMHzmWA0xVqVPKfTiLs2eN3OWWZUl-kQemNbpIqlKo,100
|
|
117
|
+
singlestoredb-1.3.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
|
|
118
|
+
singlestoredb-1.3.0.dist-info/top_level.txt,sha256=SDtemIXf-Kp-_F2f_S6x0db33cHGOILdAEsIQZe2LZc,35
|
|
119
|
+
singlestoredb-1.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|