singlestoredb 1.3.0__cp38-abi3-macosx_10_9_universal2.whl → 1.4.0__cp38-abi3-macosx_10_9_universal2.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.

Binary file
singlestoredb/__init__.py CHANGED
@@ -13,7 +13,7 @@ Examples
13
13
 
14
14
  """
15
15
 
16
- __version__ = '1.3.0'
16
+ __version__ = '1.4.0'
17
17
 
18
18
  from typing import Any
19
19
 
@@ -0,0 +1 @@
1
+ from .embeddings import SingleStoreEmbeddings # noqa: F401
@@ -0,0 +1,24 @@
1
+ import os as _os
2
+ from typing import Any
3
+
4
+ try:
5
+ from langchain_community.embeddings.ollama import OllamaEmbeddings
6
+ except ImportError:
7
+ raise ImportError(
8
+ 'Could not import langchain_community python package. '
9
+ 'Please install it with `pip install langchain_community`.',
10
+ )
11
+
12
+
13
+ class SingleStoreEmbeddings(OllamaEmbeddings):
14
+
15
+ def __init__(self, **kwargs: Any):
16
+ url = _os.getenv('SINGLESTORE_AI_EXPERIMENTAL_URL')
17
+ if not url:
18
+ raise ValueError(
19
+ "Environment variable 'SINGLESTORE_AI_EXPERIMENTAL_URL' must be set",
20
+ )
21
+
22
+ base_url = url.strip('/v1')
23
+ kwargs = {'model': 'nomic-embed-text', **kwargs}
24
+ super().__init__(base_url=base_url, **kwargs)
@@ -562,7 +562,6 @@ class Application(object):
562
562
  elif method == 'GET' and path == self.show_create_function_path:
563
563
  host = headers.get(b'host', b'localhost:80')
564
564
  reflected_url = f'{scope["scheme"]}://{host.decode("utf-8")}/invoke'
565
- data_format = 'json' if b'json' in content_type else 'rowdat_1'
566
565
 
567
566
  syntax = []
568
567
  for key, (endpoint, endpoint_info) in self.endpoints.items():
@@ -571,7 +570,7 @@ class Application(object):
571
570
  signature_to_sql(
572
571
  endpoint_info['signature'],
573
572
  url=self.url or reflected_url,
574
- data_format=data_format,
573
+ data_format=self.data_format,
575
574
  ),
576
575
  )
577
576
  body = '\n'.join(syntax).encode('utf-8')
@@ -35,11 +35,11 @@ class Secret(object):
35
35
  self,
36
36
  id: str,
37
37
  name: str,
38
- value: str,
39
38
  created_by: str,
40
39
  created_at: Union[str, datetime.datetime],
41
40
  last_updated_by: str,
42
41
  last_updated_at: Union[str, datetime.datetime],
42
+ value: Optional[str] = None,
43
43
  deleted_by: Optional[str] = None,
44
44
  deleted_at: Optional[Union[str, datetime.datetime]] = None,
45
45
  ):
@@ -88,11 +88,11 @@ class Secret(object):
88
88
  out = cls(
89
89
  id=obj['secretID'],
90
90
  name=obj['name'],
91
- value=obj['value'],
92
91
  created_by=obj['createdBy'],
93
92
  created_at=obj['createdAt'],
94
93
  last_updated_by=obj['lastUpdatedBy'],
95
94
  last_updated_at=obj['lastUpdatedAt'],
95
+ value=obj.get('value'),
96
96
  deleted_by=obj.get('deletedBy'),
97
97
  deleted_at=obj.get('deletedAt'),
98
98
  )
@@ -39,7 +39,7 @@ def get_organization() -> Organization:
39
39
  return manage_workspaces().organization
40
40
 
41
41
 
42
- def get_secret(name: str) -> str:
42
+ def get_secret(name: str) -> Optional[str]:
43
43
  """Get a secret from the organization."""
44
44
  return get_organization().get_secret(name).value
45
45
 
@@ -1858,6 +1858,7 @@ class MySQLResultSV(MySQLResult):
1858
1858
  parse_json=connection.parse_json,
1859
1859
  invalid_values=connection.invalid_values,
1860
1860
  unbuffered=unbuffered,
1861
+ encoding_errors=connection.encoding_errors,
1861
1862
  ).items() if v is not UNSET
1862
1863
  }
1863
1864
  self._read_rowdata_packet = functools.partial(
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  import functools
3
3
  from typing import Any
4
+ from typing import Optional
4
5
 
5
6
  from ..management import workspace as _ws
6
7
 
@@ -8,12 +9,12 @@ from ..management import workspace as _ws
8
9
  class Secrets(object):
9
10
  """Wrapper for accessing secrets as object attributes."""
10
11
 
11
- def __getattr__(self, name: str) -> str:
12
+ def __getattr__(self, name: str) -> Optional[str]:
12
13
  if name.startswith('_ipython') or name.startswith('_repr_'):
13
14
  raise AttributeError(name)
14
15
  return _ws.get_secret(name)
15
16
 
16
- def __getitem__(self, name: str) -> str:
17
+ def __getitem__(self, name: str) -> Optional[str]:
17
18
  return _ws.get_secret(name)
18
19
 
19
20
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: singlestoredb
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: Interface to the SingleStoreDB database and workspace management APIs
5
5
  Home-page: https://github.com/singlestore-labs/singlestoredb-python
6
6
  Author: SingleStore
@@ -1,13 +1,13 @@
1
- _singlestoredb_accel.abi3.so,sha256=UxjCadI_UT1uCyJFel3lMm2PEB7c8-x409GIYdtoVjY,206605
2
- singlestoredb-1.3.0.dist-info/RECORD,,
3
- singlestoredb-1.3.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
4
- singlestoredb-1.3.0.dist-info/WHEEL,sha256=_VEguvlLpUd-c8RbFMA4yMIVNMBv2LhpxYLCEQ-Bogk,113
5
- singlestoredb-1.3.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
6
- singlestoredb-1.3.0.dist-info/top_level.txt,sha256=SDtemIXf-Kp-_F2f_S6x0db33cHGOILdAEsIQZe2LZc,35
7
- singlestoredb-1.3.0.dist-info/METADATA,sha256=PLBzts-ZoiYv7LrQvRGSKycJ9DJ7W2KsnLMDkFJ_1LA,5570
1
+ _singlestoredb_accel.abi3.so,sha256=evzNomTGzEDJj-60bduWoJizZvcZY87fyRf8nIUGqPA,206605
2
+ singlestoredb-1.4.0.dist-info/RECORD,,
3
+ singlestoredb-1.4.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
4
+ singlestoredb-1.4.0.dist-info/WHEEL,sha256=_VEguvlLpUd-c8RbFMA4yMIVNMBv2LhpxYLCEQ-Bogk,113
5
+ singlestoredb-1.4.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
6
+ singlestoredb-1.4.0.dist-info/top_level.txt,sha256=SDtemIXf-Kp-_F2f_S6x0db33cHGOILdAEsIQZe2LZc,35
7
+ singlestoredb-1.4.0.dist-info/METADATA,sha256=wpLknCKi47UISY50QQ2meZGjhPxpsDMwTIKrQFhKJiA,5570
8
8
  singlestoredb/auth.py,sha256=u8D9tpKzrqa4ssaHjyZnGDX1q8XBpGtuoOkTkSv7B28,7599
9
9
  singlestoredb/config.py,sha256=H4pQxqBEGGCmVHg40VEnAdqGXHun8ougZzj-Ed6ZLH4,11822
10
- singlestoredb/__init__.py,sha256=juu9u0zHHRDvLViF83NCU4pBRNBPEDElq5-VpoIoErg,1634
10
+ singlestoredb/__init__.py,sha256=SiAqHTUbyK9Lcd_4o_x53u-uxkWZAE-XW3YM2zp4CqA,1634
11
11
  singlestoredb/types.py,sha256=FIqO1A7e0Gkk7ITmIysBy-P5S--ItbMSlYvblzqGS30,9969
12
12
  singlestoredb/connection.py,sha256=aLc9_9q5pJ2DCHbmBkWP-4KlDPGoCyB92yaQfNtcnSA,44958
13
13
  singlestoredb/pytest.py,sha256=OyF3BO9mgxenifYhOihnzGk8WzCJ_zN5_mxe8XyFPOc,9074
@@ -44,12 +44,12 @@ singlestoredb/tests/test_dbapi.py,sha256=IKq5Hcwx8WikASP8_AB5fo3TXv7ryWPCVGonoly
44
44
  singlestoredb/tests/test_types.py,sha256=jqoAaSjhbgwB3vt0KsTcl7XBWoMMIa0mPFKhEi5bBjo,4500
45
45
  singlestoredb/tests/test2.sql,sha256=D4U2GSlOVeo39U8-RMM4YziJzYFfi4Ztm2YXJVJVAS8,37
46
46
  singlestoredb/tests/ext_funcs/__init__.py,sha256=qZLnDI_Ck0tguVi-K-BKXDHAcC0jui3dsm93Djj4x08,9290
47
- singlestoredb/management/organization.py,sha256=OtAMTYkxgAYHh8QDUqez9Nq2X6AjP78izuQ5m19-qAE,4974
47
+ singlestoredb/management/organization.py,sha256=Y0JFSxYF_UOjip53gcbBXWPCe_t92zo3d99jZNrhkx4,4995
48
48
  singlestoredb/management/region.py,sha256=HnLcWUh7r_aLECliplCDHak4a_F3B7LOSXEYMW66qD0,1611
49
49
  singlestoredb/management/__init__.py,sha256=puMnH8S3BWEgIlAmuLLh_ZqTN1jml7E8Mme30vkmPOQ,235
50
50
  singlestoredb/management/utils.py,sha256=QKagKjAhezmBaGfNh81ncbA321mMV243cUY4CUMdcK8,9197
51
51
  singlestoredb/management/cluster.py,sha256=_TT4tV43VPDrtcdS_VN-TTYij7yFQzjAMeuYRF9zKj8,14362
52
- singlestoredb/management/workspace.py,sha256=jHNTZ_zqi80U20BS6ezJX5DLZxWX_68fV1GW870hh5s,61632
52
+ singlestoredb/management/workspace.py,sha256=ie93R8_fWGaHgxByUk5hKVkcc9VEbDY4kf5nm68dN1U,61642
53
53
  singlestoredb/management/manager.py,sha256=m8I5zTmEqjMCEE4fmmVdzza8TvofhnIHvO0np0WH-Y8,8810
54
54
  singlestoredb/management/billing_usage.py,sha256=9ighjIpcopgIyJOktBYQ6pahBZmWGHOPyyCW4gu9FGs,3735
55
55
  singlestoredb/utils/config.py,sha256=m3Xn6hsbdKyLufSnbokhFJ9Vfaz9Qpkj1IEnIiH9oJQ,24503
@@ -62,11 +62,13 @@ singlestoredb/utils/debug.py,sha256=0JiLA37u_9CKiDGiN9BK_PtFMUku3vIcNjERWaTNRSU,
62
62
  singlestoredb/utils/mogrify.py,sha256=-a56IF70U6CkfadeaZgfjRSVsAD3PuqRrzPpjZlgbwY,4050
63
63
  singlestoredb/http/__init__.py,sha256=A_2ZUCCpvRYIA6YDpPy57wL5R1eZ5SfP6I1To5nfJ2s,912
64
64
  singlestoredb/http/connection.py,sha256=HUYzgiGYRUblHhgDi-ghfXykGkdB9iQ3i_XVvhtqH88,39349
65
+ singlestoredb/ai/__init__.py,sha256=7Pubobzx5OlyepNo5DOOxWev1DUW9WFc9P6Qver2xpY,60
66
+ singlestoredb/ai/embeddings.py,sha256=3jghE4WMf7vy8RobhrMOLvMLnDNGbkPCF48B3fGM38U,746
65
67
  singlestoredb/mysql/protocol.py,sha256=2GG8qTXy5npqo7z2D2K5T0S8PtoUOS-hFDEXy8VConw,14451
66
68
  singlestoredb/mysql/cursors.py,sha256=Eqe7jITRvOo4P_TxIarTumg_2PG1DcCfZ4Uo9IFdDa8,26794
67
69
  singlestoredb/mysql/__init__.py,sha256=olUTAvkiERhDW41JXQMawkg-i0tvBEkoTkII1tt6lxU,4492
68
70
  singlestoredb/mysql/times.py,sha256=2j7purNVnJmjhOUgwUze-r3kNlCWqxjXj-jtqOzBfZI,463
69
- singlestoredb/mysql/connection.py,sha256=WZZl3cWLsyuKlQfB3CzXRmXnAXcTLDBUG8eAViYEwDw,70301
71
+ singlestoredb/mysql/connection.py,sha256=px1_uGW1h1zwebYkIXmOjASmEXkc_ZQrLb3JNKfUS0w,70361
70
72
  singlestoredb/mysql/charset.py,sha256=-FlONDS_oAUF5B3mIgeHBPb_SCt4zHD33arUeBNctU0,10510
71
73
  singlestoredb/mysql/converters.py,sha256=CVe8SDmjbIAhy1xpQ2N5OKWw6t5eWpw-EU3QTlA0Hh0,7500
72
74
  singlestoredb/mysql/optionfile.py,sha256=DqL-rOQcqQncD5eVbPRkwZqo7Pj3Vh40VLx3E_e87TU,655
@@ -107,7 +109,7 @@ singlestoredb/functions/decorator.py,sha256=H12MUeBw8VOppx6esntaR43ukeIffbnAr716
107
109
  singlestoredb/functions/__init__.py,sha256=WL1LqgMTdnGOse3tQqmD-HH8TdfCPS89GNO7hO0v_aw,41
108
110
  singlestoredb/functions/dtypes.py,sha256=a2vevIug8NhiUCFiSOKwRPpdWU69Gn13ZoQ6Aovskhc,31408
109
111
  singlestoredb/functions/signature.py,sha256=fNnlTfc0R0sM9wm78UwG7Ok9eMJTtOfawrIpjts2wdY,18866
110
- singlestoredb/functions/ext/asgi.py,sha256=orEm0MGziXRgCqV-TdT-A4lpy_zaKGtkg9sfHsbsfz0,40088
112
+ singlestoredb/functions/ext/asgi.py,sha256=YV4i5RmnSsPvdJPM7_z9X3oR9b1zdZq2ylTSEAM_G54,40017
111
113
  singlestoredb/functions/ext/arrow.py,sha256=WB7n1ACslyd8nlbFzUvlbxn1BVuEjA9-BGBEqCWlSOo,9061
112
114
  singlestoredb/functions/ext/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
113
115
  singlestoredb/functions/ext/utils.py,sha256=2-B8YU_Iekv8JcpI-ochs9TIeuyatLaLAH-AyYyUUIg,5311
@@ -115,5 +117,5 @@ singlestoredb/functions/ext/mmap.py,sha256=OB6CIYoLe_AYuJM10lE0I6QhZJ5kMhLNbQo2S
115
117
  singlestoredb/functions/ext/json.py,sha256=XkI8jirxi1T9F-M0p9NpLezph0MRAhYmDiPuU2Id0Uo,10404
116
118
  singlestoredb/functions/ext/rowdat_1.py,sha256=JgKRsVSQYczFD6cmo2xLilbNPYpyLL2tPOWO1Gh25ow,22306
117
119
  singlestoredb/notebook/__init__.py,sha256=5_Nfme_Tt6e22LoId6xpaiNcVYPR3pmHXDt7EoX9E6o,491
118
- singlestoredb/notebook/_objects.py,sha256=YbJSp1meOP0Z4dyNmIQ6v823u5Yj0bKP7qRjiL2pN_k,7995
120
+ singlestoredb/notebook/_objects.py,sha256=MkB1eowEq5SQXFHY00xAKAyyeLqHu_uaZiA20BCJPaE,8043
119
121
  singlestoredb/alchemy/__init__.py,sha256=dXRThusYrs_9GjrhPOw0-vw94in_T8yY9jE7SGCqiQk,2523