singlestoredb 1.3.0__py3-none-any.whl → 1.4.0__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 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,4 +1,4 @@
1
- singlestoredb/__init__.py,sha256=juu9u0zHHRDvLViF83NCU4pBRNBPEDElq5-VpoIoErg,1634
1
+ singlestoredb/__init__.py,sha256=SiAqHTUbyK9Lcd_4o_x53u-uxkWZAE-XW3YM2zp4CqA,1634
2
2
  singlestoredb/auth.py,sha256=u8D9tpKzrqa4ssaHjyZnGDX1q8XBpGtuoOkTkSv7B28,7599
3
3
  singlestoredb/config.py,sha256=H4pQxqBEGGCmVHg40VEnAdqGXHun8ougZzj-Ed6ZLH4,11822
4
4
  singlestoredb/connection.py,sha256=aLc9_9q5pJ2DCHbmBkWP-4KlDPGoCyB92yaQfNtcnSA,44958
@@ -6,6 +6,8 @@ singlestoredb/converters.py,sha256=t1hRMZfccWJs_WyOw-W-Kh87fxsOkpOnKXAeh_Nr-zU,2
6
6
  singlestoredb/exceptions.py,sha256=HuoA6sMRL5qiCiee-_5ddTGmFbYC9Euk8TYUsh5GvTw,3234
7
7
  singlestoredb/pytest.py,sha256=OyF3BO9mgxenifYhOihnzGk8WzCJ_zN5_mxe8XyFPOc,9074
8
8
  singlestoredb/types.py,sha256=FIqO1A7e0Gkk7ITmIysBy-P5S--ItbMSlYvblzqGS30,9969
9
+ singlestoredb/ai/__init__.py,sha256=7Pubobzx5OlyepNo5DOOxWev1DUW9WFc9P6Qver2xpY,60
10
+ singlestoredb/ai/embeddings.py,sha256=3jghE4WMf7vy8RobhrMOLvMLnDNGbkPCF48B3fGM38U,746
9
11
  singlestoredb/alchemy/__init__.py,sha256=dXRThusYrs_9GjrhPOw0-vw94in_T8yY9jE7SGCqiQk,2523
10
12
  singlestoredb/functions/__init__.py,sha256=WL1LqgMTdnGOse3tQqmD-HH8TdfCPS89GNO7hO0v_aw,41
11
13
  singlestoredb/functions/decorator.py,sha256=H12MUeBw8VOppx6esntaR43ukeIffbnAr716CBpYJ4g,5193
@@ -13,7 +15,7 @@ singlestoredb/functions/dtypes.py,sha256=a2vevIug8NhiUCFiSOKwRPpdWU69Gn13ZoQ6Aov
13
15
  singlestoredb/functions/signature.py,sha256=fNnlTfc0R0sM9wm78UwG7Ok9eMJTtOfawrIpjts2wdY,18866
14
16
  singlestoredb/functions/ext/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
15
17
  singlestoredb/functions/ext/arrow.py,sha256=WB7n1ACslyd8nlbFzUvlbxn1BVuEjA9-BGBEqCWlSOo,9061
16
- singlestoredb/functions/ext/asgi.py,sha256=orEm0MGziXRgCqV-TdT-A4lpy_zaKGtkg9sfHsbsfz0,40088
18
+ singlestoredb/functions/ext/asgi.py,sha256=YV4i5RmnSsPvdJPM7_z9X3oR9b1zdZq2ylTSEAM_G54,40017
17
19
  singlestoredb/functions/ext/json.py,sha256=XkI8jirxi1T9F-M0p9NpLezph0MRAhYmDiPuU2Id0Uo,10404
18
20
  singlestoredb/functions/ext/mmap.py,sha256=OB6CIYoLe_AYuJM10lE0I6QhZJ5kMhLNbQo2Sp1wiZA,13711
19
21
  singlestoredb/functions/ext/rowdat_1.py,sha256=JgKRsVSQYczFD6cmo2xLilbNPYpyLL2tPOWO1Gh25ow,22306
@@ -33,14 +35,14 @@ singlestoredb/management/__init__.py,sha256=puMnH8S3BWEgIlAmuLLh_ZqTN1jml7E8Mme3
33
35
  singlestoredb/management/billing_usage.py,sha256=9ighjIpcopgIyJOktBYQ6pahBZmWGHOPyyCW4gu9FGs,3735
34
36
  singlestoredb/management/cluster.py,sha256=_TT4tV43VPDrtcdS_VN-TTYij7yFQzjAMeuYRF9zKj8,14362
35
37
  singlestoredb/management/manager.py,sha256=m8I5zTmEqjMCEE4fmmVdzza8TvofhnIHvO0np0WH-Y8,8810
36
- singlestoredb/management/organization.py,sha256=OtAMTYkxgAYHh8QDUqez9Nq2X6AjP78izuQ5m19-qAE,4974
38
+ singlestoredb/management/organization.py,sha256=Y0JFSxYF_UOjip53gcbBXWPCe_t92zo3d99jZNrhkx4,4995
37
39
  singlestoredb/management/region.py,sha256=HnLcWUh7r_aLECliplCDHak4a_F3B7LOSXEYMW66qD0,1611
38
40
  singlestoredb/management/utils.py,sha256=QKagKjAhezmBaGfNh81ncbA321mMV243cUY4CUMdcK8,9197
39
- singlestoredb/management/workspace.py,sha256=jHNTZ_zqi80U20BS6ezJX5DLZxWX_68fV1GW870hh5s,61632
41
+ singlestoredb/management/workspace.py,sha256=ie93R8_fWGaHgxByUk5hKVkcc9VEbDY4kf5nm68dN1U,61642
40
42
  singlestoredb/mysql/__init__.py,sha256=olUTAvkiERhDW41JXQMawkg-i0tvBEkoTkII1tt6lxU,4492
41
43
  singlestoredb/mysql/_auth.py,sha256=AugRitoUwgRIDFuJxuAH4MWIAmckY7Ji2pP6r_Ng9dY,8043
42
44
  singlestoredb/mysql/charset.py,sha256=-FlONDS_oAUF5B3mIgeHBPb_SCt4zHD33arUeBNctU0,10510
43
- singlestoredb/mysql/connection.py,sha256=WZZl3cWLsyuKlQfB3CzXRmXnAXcTLDBUG8eAViYEwDw,70301
45
+ singlestoredb/mysql/connection.py,sha256=px1_uGW1h1zwebYkIXmOjASmEXkc_ZQrLb3JNKfUS0w,70361
44
46
  singlestoredb/mysql/converters.py,sha256=CVe8SDmjbIAhy1xpQ2N5OKWw6t5eWpw-EU3QTlA0Hh0,7500
45
47
  singlestoredb/mysql/cursors.py,sha256=Eqe7jITRvOo4P_TxIarTumg_2PG1DcCfZ4Uo9IFdDa8,26794
46
48
  singlestoredb/mysql/err.py,sha256=-m5rqXi8yhq6b8SCEJ2h0E5Rudh_15dlAU_WbJ1YrM8,2388
@@ -79,7 +81,7 @@ singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py,s
79
81
  singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py,sha256=t_OzqsVnj_ReBbmY_wx51ZcWbLz9nASZ0hno-9YeiyQ,8022
80
82
  singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py,sha256=pl0bvuZo_nzAlYOINxRiR-Zi9khz0W2Pc7vP-K3sQYQ,2819
81
83
  singlestoredb/notebook/__init__.py,sha256=5_Nfme_Tt6e22LoId6xpaiNcVYPR3pmHXDt7EoX9E6o,491
82
- singlestoredb/notebook/_objects.py,sha256=YbJSp1meOP0Z4dyNmIQ6v823u5Yj0bKP7qRjiL2pN_k,7995
84
+ singlestoredb/notebook/_objects.py,sha256=MkB1eowEq5SQXFHY00xAKAyyeLqHu_uaZiA20BCJPaE,8043
83
85
  singlestoredb/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
86
  singlestoredb/tests/empty.sql,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
87
  singlestoredb/tests/local_infile.csv,sha256=sBtqjvfkS9aoOVx8nMXYgYv4rDuT4OuYhqUhNRu0O68,42
@@ -110,9 +112,9 @@ singlestoredb/utils/dtypes.py,sha256=1qUiB4BJFJ7rOVh2mItQssYbJupV7uq1x8uwX-Eu2Ks
110
112
  singlestoredb/utils/mogrify.py,sha256=-a56IF70U6CkfadeaZgfjRSVsAD3PuqRrzPpjZlgbwY,4050
111
113
  singlestoredb/utils/results.py,sha256=bJtaUaDiFq26IsPAKZ2FHGB7csMn94EAxLKrP4HaEEA,15277
112
114
  singlestoredb/utils/xdict.py,sha256=S9HKgrPrnu_6b7iOwa2KrW8CmU1Uqx0BWdEyogFzWbE,12896
113
- singlestoredb-1.3.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
114
- singlestoredb-1.3.0.dist-info/METADATA,sha256=PLBzts-ZoiYv7LrQvRGSKycJ9DJ7W2KsnLMDkFJ_1LA,5570
115
- singlestoredb-1.3.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
116
- singlestoredb-1.3.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
117
- singlestoredb-1.3.0.dist-info/top_level.txt,sha256=eet8bVPNRqiGeY0PrO5ERH2UpamwlrKHEQCffz4dOh8,14
118
- singlestoredb-1.3.0.dist-info/RECORD,,
115
+ singlestoredb-1.4.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
116
+ singlestoredb-1.4.0.dist-info/METADATA,sha256=wpLknCKi47UISY50QQ2meZGjhPxpsDMwTIKrQFhKJiA,5570
117
+ singlestoredb-1.4.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
118
+ singlestoredb-1.4.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
119
+ singlestoredb-1.4.0.dist-info/top_level.txt,sha256=eet8bVPNRqiGeY0PrO5ERH2UpamwlrKHEQCffz4dOh8,14
120
+ singlestoredb-1.4.0.dist-info/RECORD,,