singlestoredb 0.3.3__py3-none-any.whl → 1.0.3__py3-none-any.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/__init__.py +33 -2
- singlestoredb/alchemy/__init__.py +90 -0
- singlestoredb/auth.py +6 -4
- singlestoredb/config.py +116 -16
- singlestoredb/connection.py +489 -523
- singlestoredb/converters.py +275 -26
- singlestoredb/exceptions.py +30 -4
- singlestoredb/functions/__init__.py +1 -0
- singlestoredb/functions/decorator.py +142 -0
- singlestoredb/functions/dtypes.py +1639 -0
- singlestoredb/functions/ext/__init__.py +2 -0
- singlestoredb/functions/ext/arrow.py +375 -0
- singlestoredb/functions/ext/asgi.py +661 -0
- singlestoredb/functions/ext/json.py +427 -0
- singlestoredb/functions/ext/mmap.py +306 -0
- singlestoredb/functions/ext/rowdat_1.py +744 -0
- singlestoredb/functions/signature.py +673 -0
- singlestoredb/fusion/__init__.py +11 -0
- singlestoredb/fusion/graphql.py +213 -0
- singlestoredb/fusion/handler.py +621 -0
- singlestoredb/fusion/handlers/__init__.py +0 -0
- singlestoredb/fusion/handlers/stage.py +257 -0
- singlestoredb/fusion/handlers/utils.py +162 -0
- singlestoredb/fusion/handlers/workspace.py +412 -0
- singlestoredb/fusion/registry.py +164 -0
- singlestoredb/fusion/result.py +399 -0
- singlestoredb/http/__init__.py +27 -0
- singlestoredb/http/connection.py +1192 -0
- singlestoredb/management/__init__.py +3 -2
- singlestoredb/management/billing_usage.py +148 -0
- singlestoredb/management/cluster.py +19 -14
- singlestoredb/management/manager.py +100 -40
- singlestoredb/management/organization.py +188 -0
- singlestoredb/management/region.py +6 -8
- singlestoredb/management/utils.py +253 -4
- singlestoredb/management/workspace.py +1153 -35
- singlestoredb/mysql/__init__.py +177 -0
- singlestoredb/mysql/_auth.py +298 -0
- singlestoredb/mysql/charset.py +214 -0
- singlestoredb/mysql/connection.py +1814 -0
- singlestoredb/mysql/constants/CLIENT.py +38 -0
- singlestoredb/mysql/constants/COMMAND.py +32 -0
- singlestoredb/mysql/constants/CR.py +78 -0
- singlestoredb/mysql/constants/ER.py +474 -0
- singlestoredb/mysql/constants/FIELD_TYPE.py +32 -0
- singlestoredb/mysql/constants/FLAG.py +15 -0
- singlestoredb/mysql/constants/SERVER_STATUS.py +10 -0
- singlestoredb/mysql/constants/__init__.py +0 -0
- singlestoredb/mysql/converters.py +271 -0
- singlestoredb/mysql/cursors.py +713 -0
- singlestoredb/mysql/err.py +92 -0
- singlestoredb/mysql/optionfile.py +20 -0
- singlestoredb/mysql/protocol.py +388 -0
- singlestoredb/mysql/tests/__init__.py +19 -0
- singlestoredb/mysql/tests/base.py +126 -0
- singlestoredb/mysql/tests/conftest.py +37 -0
- singlestoredb/mysql/tests/test_DictCursor.py +132 -0
- singlestoredb/mysql/tests/test_SSCursor.py +141 -0
- singlestoredb/mysql/tests/test_basic.py +452 -0
- singlestoredb/mysql/tests/test_connection.py +851 -0
- singlestoredb/mysql/tests/test_converters.py +58 -0
- singlestoredb/mysql/tests/test_cursor.py +141 -0
- singlestoredb/mysql/tests/test_err.py +16 -0
- singlestoredb/mysql/tests/test_issues.py +514 -0
- singlestoredb/mysql/tests/test_load_local.py +75 -0
- singlestoredb/mysql/tests/test_nextset.py +88 -0
- singlestoredb/mysql/tests/test_optionfile.py +27 -0
- singlestoredb/mysql/tests/thirdparty/__init__.py +6 -0
- singlestoredb/mysql/tests/thirdparty/test_MySQLdb/__init__.py +9 -0
- singlestoredb/mysql/tests/thirdparty/test_MySQLdb/capabilities.py +323 -0
- singlestoredb/mysql/tests/thirdparty/test_MySQLdb/dbapi20.py +865 -0
- singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py +110 -0
- singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py +224 -0
- singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py +101 -0
- singlestoredb/mysql/times.py +23 -0
- singlestoredb/pytest.py +283 -0
- singlestoredb/tests/empty.sql +0 -0
- singlestoredb/tests/ext_funcs/__init__.py +385 -0
- singlestoredb/tests/test.sql +210 -0
- singlestoredb/tests/test2.sql +1 -0
- singlestoredb/tests/test_basics.py +482 -117
- singlestoredb/tests/test_config.py +13 -15
- singlestoredb/tests/test_connection.py +241 -289
- singlestoredb/tests/test_dbapi.py +27 -0
- singlestoredb/tests/test_exceptions.py +0 -2
- singlestoredb/tests/test_ext_func.py +1193 -0
- singlestoredb/tests/test_ext_func_data.py +1101 -0
- singlestoredb/tests/test_fusion.py +465 -0
- singlestoredb/tests/test_http.py +32 -28
- singlestoredb/tests/test_management.py +588 -10
- singlestoredb/tests/test_plugin.py +33 -0
- singlestoredb/tests/test_results.py +11 -14
- singlestoredb/tests/test_types.py +0 -2
- singlestoredb/tests/test_udf.py +687 -0
- singlestoredb/tests/test_xdict.py +0 -2
- singlestoredb/tests/utils.py +3 -4
- singlestoredb/types.py +4 -5
- singlestoredb/utils/config.py +71 -12
- singlestoredb/utils/convert_rows.py +0 -2
- singlestoredb/utils/debug.py +13 -0
- singlestoredb/utils/mogrify.py +151 -0
- singlestoredb/utils/results.py +4 -3
- singlestoredb/utils/xdict.py +12 -12
- singlestoredb-1.0.3.dist-info/METADATA +139 -0
- singlestoredb-1.0.3.dist-info/RECORD +112 -0
- {singlestoredb-0.3.3.dist-info → singlestoredb-1.0.3.dist-info}/WHEEL +1 -1
- singlestoredb-1.0.3.dist-info/entry_points.txt +2 -0
- singlestoredb/drivers/__init__.py +0 -46
- singlestoredb/drivers/base.py +0 -200
- singlestoredb/drivers/cymysql.py +0 -40
- singlestoredb/drivers/http.py +0 -49
- singlestoredb/drivers/mariadb.py +0 -42
- singlestoredb/drivers/mysqlconnector.py +0 -51
- singlestoredb/drivers/mysqldb.py +0 -62
- singlestoredb/drivers/pymysql.py +0 -39
- singlestoredb/drivers/pyodbc.py +0 -67
- singlestoredb/http.py +0 -794
- singlestoredb-0.3.3.dist-info/METADATA +0 -105
- singlestoredb-0.3.3.dist-info/RECORD +0 -46
- {singlestoredb-0.3.3.dist-info → singlestoredb-1.0.3.dist-info}/LICENSE +0 -0
- {singlestoredb-0.3.3.dist-info → singlestoredb-1.0.3.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# type: ignore
|
|
3
3
|
"""Test SingleStoreDB results."""
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
4
|
import os
|
|
7
5
|
import unittest
|
|
8
6
|
|
|
@@ -31,7 +29,6 @@ class TestResults(unittest.TestCase):
|
|
|
31
29
|
def setUp(self):
|
|
32
30
|
self.conn = s2.connect(database=type(self).dbname)
|
|
33
31
|
self.cur = self.conn.cursor()
|
|
34
|
-
self.driver = self.conn._driver.dbapi.__name__
|
|
35
32
|
|
|
36
33
|
def tearDown(self):
|
|
37
34
|
try:
|
|
@@ -49,12 +46,12 @@ class TestResults(unittest.TestCase):
|
|
|
49
46
|
pass
|
|
50
47
|
|
|
51
48
|
def test_tuples(self):
|
|
52
|
-
with s2.options(('results.
|
|
49
|
+
with s2.options(('results.type', 'tuples')):
|
|
53
50
|
with s2.connect(database=type(self).dbname) as conn:
|
|
54
51
|
with conn.cursor() as cur:
|
|
55
52
|
cur.execute('select * from data')
|
|
56
53
|
out = cur.fetchone()
|
|
57
|
-
assert type(out)
|
|
54
|
+
assert type(out) is tuple, type(out)
|
|
58
55
|
assert len(out) == 3, len(out)
|
|
59
56
|
cur.fetchall()
|
|
60
57
|
|
|
@@ -62,7 +59,7 @@ class TestResults(unittest.TestCase):
|
|
|
62
59
|
out = cur.fetchall()
|
|
63
60
|
assert len(out) == 5, len(out)
|
|
64
61
|
assert len(out[0]) == 3, len(out[0])
|
|
65
|
-
assert type(out[0])
|
|
62
|
+
assert type(out[0]) is tuple, type(out[0])
|
|
66
63
|
assert sorted(out) == sorted([
|
|
67
64
|
('a', 'antelopes', 2),
|
|
68
65
|
('b', 'bears', 2),
|
|
@@ -75,7 +72,7 @@ class TestResults(unittest.TestCase):
|
|
|
75
72
|
assert len(out) == 0, len(out)
|
|
76
73
|
|
|
77
74
|
def test_namedtuples(self):
|
|
78
|
-
with s2.options(('results.
|
|
75
|
+
with s2.options(('results.type', 'namedtuples')):
|
|
79
76
|
with s2.connect(database=type(self).dbname) as conn:
|
|
80
77
|
with conn.cursor() as cur:
|
|
81
78
|
cur.execute('select * from data')
|
|
@@ -109,18 +106,18 @@ class TestResults(unittest.TestCase):
|
|
|
109
106
|
assert len(out) == 0, len(out)
|
|
110
107
|
|
|
111
108
|
def test_dict(self):
|
|
112
|
-
with s2.options(('results.
|
|
109
|
+
with s2.options(('results.type', 'dicts')):
|
|
113
110
|
with s2.connect(database=type(self).dbname) as conn:
|
|
114
111
|
with conn.cursor() as cur:
|
|
115
112
|
cur.execute('select * from data')
|
|
116
113
|
out = cur.fetchone()
|
|
117
|
-
assert type(out)
|
|
114
|
+
assert type(out) is dict, type(out)
|
|
118
115
|
assert len(out) == 3, len(out)
|
|
119
116
|
cur.fetchall()
|
|
120
117
|
|
|
121
118
|
cur.execute('select * from data')
|
|
122
119
|
out = cur.fetchall()
|
|
123
|
-
assert type(out[0])
|
|
120
|
+
assert type(out[0]) is dict, type(out[0])
|
|
124
121
|
assert len(out) == 5, len(out)
|
|
125
122
|
assert len(out[0]) == 3, len(out[0])
|
|
126
123
|
assert sorted(out, key=lambda x: x['id']) == sorted(
|
|
@@ -136,19 +133,19 @@ class TestResults(unittest.TestCase):
|
|
|
136
133
|
out = cur.fetchall()
|
|
137
134
|
assert len(out) == 0, len(out)
|
|
138
135
|
|
|
139
|
-
def
|
|
140
|
-
with s2.options(('results.
|
|
136
|
+
def _test_dataframe(self):
|
|
137
|
+
with s2.options(('results.type', 'dataframe')):
|
|
141
138
|
with s2.connect(database=type(self).dbname) as conn:
|
|
142
139
|
with conn.cursor() as cur:
|
|
143
140
|
cur.execute('select * from data')
|
|
144
141
|
out = cur.fetchone()
|
|
145
|
-
assert type(out)
|
|
142
|
+
assert type(out) is pd.DataFrame, type(out)
|
|
146
143
|
assert len(out) == 1, len(out)
|
|
147
144
|
cur.fetchall()
|
|
148
145
|
|
|
149
146
|
cur.execute('select * from data')
|
|
150
147
|
out = cur.fetchall()
|
|
151
|
-
assert type(out)
|
|
148
|
+
assert type(out) is pd.DataFrame, type(out)
|
|
152
149
|
assert len(out) == 5, len(out)
|
|
153
150
|
out = out.sort_values('id').reset_index(drop=True)
|
|
154
151
|
exp = pd.DataFrame(
|