singlestoredb 1.9.0__cp38-abi3-macosx_10_9_universal2.whl → 1.10.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.9.0'
16
+ __version__ = '1.10.0'
17
17
 
18
18
  from typing import Any
19
19
 
@@ -641,13 +641,6 @@ class SQLHandler(NodeVisitor):
641
641
  DummySQLResult
642
642
 
643
643
  """
644
- import warnings
645
- warnings.warn(
646
- 'Fusion SQL is currently a preview feature. '
647
- 'Run `SHOW FUSION COMMANDS` to see all commands.',
648
- RuntimeWarning,
649
- )
650
-
651
644
  type(self).compile()
652
645
  self._handled = set()
653
646
  try:
@@ -55,10 +55,10 @@ class CreateClusterIdentity(SQLHandler):
55
55
 
56
56
  CREATE CLUSTER IDENTITY
57
57
  CATALOG CONFIG '{
58
- "type": "GLUE",
58
+ "catalog_type": "GLUE",
59
59
  "table_format": "ICEBERG",
60
- "id": "13983498723498",
61
- "region": "us-east-1"
60
+ "catalog_id": "13983498723498",
61
+ "catalog_region": "us-east-1"
62
62
  }'
63
63
  LINK S3 CONFIG '{
64
64
  "region": "us-east-1",
@@ -78,6 +78,8 @@ class CreateClusterIdentity(SQLHandler):
78
78
  storage_config = json.loads(params['storage'].get('link_config', '{}') or '{}')
79
79
  storage_creds = json.loads(params['storage'].get('link_creds', '{}') or '{}')
80
80
 
81
+ storage_config['provider'] = 'S3'
82
+
81
83
  wsg = get_workspace_group({})
82
84
 
83
85
  if wsg._manager is None:
@@ -145,12 +147,12 @@ class CreateExport(SQLHandler):
145
147
  catalog and link configurations. The source table to export is
146
148
  named "customer_data"::
147
149
 
148
- START EXPORT FROM customer_data
150
+ START EXPORT FROM my_db.customer_data
149
151
  CATALOG CONFIG '{
150
- "type": "GLUE",
152
+ "catalog_type": "GLUE",
151
153
  "table_format": "ICEBERG",
152
- "id": "13983498723498",
153
- "region": "us-east-1"
154
+ "catalog_id": "13983498723498",
155
+ "catalog_region": "us-east-1"
154
156
  }'
155
157
  LINK S3 CONFIG '{
156
158
  "region": "us-east-1",
@@ -177,6 +179,8 @@ class CreateExport(SQLHandler):
177
179
  storage_config = json.loads(params['storage'].get('link_config', '{}') or '{}')
178
180
  storage_creds = json.loads(params['storage'].get('link_creds', '{}') or '{}')
179
181
 
182
+ storage_config['provider'] = 'S3'
183
+
180
184
  wsg = get_workspace_group({})
181
185
 
182
186
  if from_database is None:
@@ -0,0 +1,34 @@
1
+ from IPython.core.interactiveshell import InteractiveShell
2
+
3
+ from .run_personal import RunPersonalMagic
4
+ from .run_shared import RunSharedMagic
5
+
6
+ # In order to actually use these magics, we must register them with a
7
+ # running IPython.
8
+
9
+
10
+ def load_ipython_extension(ip: InteractiveShell) -> None:
11
+ """
12
+ Any module file that define a function named `load_ipython_extension`
13
+ can be loaded via `%load_ext module.path` or be configured to be
14
+ autoloaded by IPython at startup time.
15
+ """
16
+
17
+ # Load jupysql extension
18
+ # This is necessary for jupysql to initialize internal state
19
+ # required to render messages
20
+ assert ip.extension_manager is not None
21
+ result = ip.extension_manager.load_extension('sql')
22
+ if result == 'no load function':
23
+ raise RuntimeError('Could not load sql extension. Is jupysql installed?')
24
+
25
+ # Check if %run magic command is defined
26
+ if ip.find_line_magic('run') is None:
27
+ raise RuntimeError(
28
+ '%run magic command is not defined. '
29
+ 'Is it available in your IPython environment?',
30
+ )
31
+
32
+ # Register run_personal and run_shared
33
+ ip.register_magics(RunPersonalMagic(ip))
34
+ ip.register_magics(RunSharedMagic(ip))
@@ -0,0 +1,56 @@
1
+ import os
2
+ import tempfile
3
+ from typing import Any
4
+
5
+ from IPython.core.interactiveshell import InteractiveShell
6
+ from IPython.core.magic import line_magic
7
+ from IPython.core.magic import Magics
8
+ from IPython.core.magic import magics_class
9
+ from IPython.core.magic import needs_local_scope
10
+ from IPython.core.magic import no_var_expand
11
+ from jinja2 import Template
12
+
13
+
14
+ @magics_class
15
+ class RunPersonalMagic(Magics):
16
+ def __init__(self, shell: InteractiveShell):
17
+ Magics.__init__(self, shell=shell)
18
+
19
+ @no_var_expand
20
+ @needs_local_scope
21
+ @line_magic('run_personal')
22
+ def run_personal(self, line: str, local_ns: Any = None) -> Any:
23
+ """
24
+ Downloads a personal file using the %sql magic and then runs it using %run.
25
+
26
+ Examples::
27
+
28
+ # Line usage
29
+
30
+ %run_personal personal_file.ipynb
31
+
32
+ %run_personal {{ sample_notebook_name }}
33
+
34
+ """
35
+
36
+ template = Template(line.strip())
37
+ personal_file = template.render(local_ns)
38
+ if not personal_file:
39
+ raise ValueError('No personal file specified.')
40
+ if (personal_file.startswith("'") and personal_file.endswith("'")) or \
41
+ (personal_file.startswith('"') and personal_file.endswith('"')):
42
+ personal_file = personal_file[1:-1]
43
+ if not personal_file:
44
+ raise ValueError('No personal file specified.')
45
+
46
+ with tempfile.TemporaryDirectory() as temp_dir:
47
+ temp_file_path = os.path.join(temp_dir, personal_file)
48
+ sql_command = (
49
+ f"DOWNLOAD PERSONAL FILE '{personal_file}' "
50
+ f"TO '{temp_file_path}'"
51
+ )
52
+
53
+ # Execute the SQL command
54
+ self.shell.run_line_magic('sql', sql_command)
55
+ # Run the downloaded file
56
+ self.shell.run_line_magic('run', f'"{temp_file_path}"')
@@ -0,0 +1,53 @@
1
+ import os
2
+ import tempfile
3
+ from typing import Any
4
+
5
+ from IPython.core.interactiveshell import InteractiveShell
6
+ from IPython.core.magic import line_magic
7
+ from IPython.core.magic import Magics
8
+ from IPython.core.magic import magics_class
9
+ from IPython.core.magic import needs_local_scope
10
+ from IPython.core.magic import no_var_expand
11
+ from jinja2 import Template
12
+
13
+
14
+ @magics_class
15
+ class RunSharedMagic(Magics):
16
+ def __init__(self, shell: InteractiveShell):
17
+ Magics.__init__(self, shell=shell)
18
+
19
+ @no_var_expand
20
+ @needs_local_scope
21
+ @line_magic('run_shared')
22
+ def run_shared(self, line: str, local_ns: Any = None) -> Any:
23
+ """
24
+ Downloads a shared file using the %sql magic and then runs it using %run.
25
+
26
+ Examples::
27
+
28
+ # Line usage
29
+
30
+ %run_shared shared_file.ipynb
31
+
32
+ %run_shared {{ sample_notebook_name }}
33
+
34
+ """
35
+
36
+ template = Template(line.strip())
37
+ shared_file = template.render(local_ns)
38
+ if not shared_file:
39
+ raise ValueError('No shared file specified.')
40
+ if (shared_file.startswith("'") and shared_file.endswith("'")) or \
41
+ (shared_file.startswith('"') and shared_file.endswith('"')):
42
+ shared_file = shared_file[1:-1]
43
+ if not shared_file:
44
+ raise ValueError('No personal file specified.')
45
+
46
+ with tempfile.TemporaryDirectory() as temp_dir:
47
+ temp_file_path = os.path.join(temp_dir, shared_file)
48
+ sql_command = f"DOWNLOAD SHARED FILE '{shared_file}' TO '{temp_file_path}'"
49
+
50
+ # Execute the SQL command
51
+ self.shell.run_line_magic('sql', sql_command)
52
+ # Run the downloaded file
53
+ self.shell.run_line_magic('run', f'"{temp_file_path}"')
@@ -333,7 +333,8 @@ class ClusterManager(Manager):
333
333
  default_version = 'v0beta'
334
334
 
335
335
  #: Base URL if none is specified.
336
- default_base_url = config.get_option('management.base_url')
336
+ default_base_url = config.get_option('management.base_url') \
337
+ or 'https://api.singlestore.com'
337
338
 
338
339
  #: Object type
339
340
  obj_type = 'cluster'
@@ -494,10 +494,11 @@ class FilesManager(Manager):
494
494
  """
495
495
 
496
496
  #: Management API version if none is specified.
497
- default_version = config.get_option('management.version')
497
+ default_version = config.get_option('management.version') or 'v1'
498
498
 
499
499
  #: Base URL if none is specified.
500
- default_base_url = config.get_option('management.base_url')
500
+ default_base_url = config.get_option('management.base_url') \
501
+ or 'https://api.singlestore.com'
501
502
 
502
503
  #: Object type
503
504
  obj_type = 'file'
@@ -43,10 +43,11 @@ class Manager(object):
43
43
  """SingleStoreDB manager base class."""
44
44
 
45
45
  #: Management API version if none is specified.
46
- default_version = config.get_option('management.version')
46
+ default_version = config.get_option('management.version') or 'v1'
47
47
 
48
48
  #: Base URL if none is specified.
49
- default_base_url = config.get_option('management.base_url')
49
+ default_base_url = config.get_option('management.base_url') \
50
+ or 'https://api.singlestore.com'
50
51
 
51
52
  #: Object type
52
53
  obj_type = ''
@@ -1481,10 +1481,11 @@ class WorkspaceManager(Manager):
1481
1481
  """
1482
1482
 
1483
1483
  #: Workspace management API version if none is specified.
1484
- default_version = config.get_option('management.version')
1484
+ default_version = config.get_option('management.version') or 'v1'
1485
1485
 
1486
1486
  #: Base URL if none is specified.
1487
- default_base_url = config.get_option('management.base_url')
1487
+ default_base_url = config.get_option('management.base_url') \
1488
+ or 'https://api.singlestore.com'
1488
1489
 
1489
1490
  #: Object type
1490
1491
  obj_type = 'workspace'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: singlestoredb
3
- Version: 1.9.0
3
+ Version: 1.10.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,15 +1,15 @@
1
- _singlestoredb_accel.abi3.so,sha256=4AphcOCSs-D4npjwijIFKrkt9jPcoq3mzNFVMEo7aio,206784
2
- singlestoredb-1.9.0.dist-info/RECORD,,
3
- singlestoredb-1.9.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
4
- singlestoredb-1.9.0.dist-info/WHEEL,sha256=_VEguvlLpUd-c8RbFMA4yMIVNMBv2LhpxYLCEQ-Bogk,113
5
- singlestoredb-1.9.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
6
- singlestoredb-1.9.0.dist-info/top_level.txt,sha256=lA65Vf4qAMfg_s1oG3LEO90h4t1Z-SPDbRqkevI3bSY,40
7
- singlestoredb-1.9.0.dist-info/METADATA,sha256=VxOWHl9E9YU1NXIka85h4tqKgk8aLXmXF_bqHqSoVeA,5570
1
+ _singlestoredb_accel.abi3.so,sha256=SK32FXKsyq4T86vB4gArceEJ5m048f9o1yGz9rTCOHo,206784
2
+ singlestoredb-1.10.0.dist-info/RECORD,,
3
+ singlestoredb-1.10.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
4
+ singlestoredb-1.10.0.dist-info/WHEEL,sha256=_VEguvlLpUd-c8RbFMA4yMIVNMBv2LhpxYLCEQ-Bogk,113
5
+ singlestoredb-1.10.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
6
+ singlestoredb-1.10.0.dist-info/top_level.txt,sha256=lA65Vf4qAMfg_s1oG3LEO90h4t1Z-SPDbRqkevI3bSY,40
7
+ singlestoredb-1.10.0.dist-info/METADATA,sha256=RObWLuSy5Mh0LcqkGSfD9pqdYGhS2OQUVfdfJf7exgo,5571
8
8
  sqlx/magic.py,sha256=JsS9_9aBFaOt91Torm1JPN0c8qB2QmYJmNSKtbSQIY0,3509
9
9
  sqlx/__init__.py,sha256=aBYiU8DZXCogvWu3yWafOz7bZS5WWwLZXj7oL0dXGyU,85
10
10
  singlestoredb/auth.py,sha256=u8D9tpKzrqa4ssaHjyZnGDX1q8XBpGtuoOkTkSv7B28,7599
11
11
  singlestoredb/config.py,sha256=ZGmnG37Ug1hT5jdTSdMJBCGDvvz2GwxrZZ_ROVV2wUE,12439
12
- singlestoredb/__init__.py,sha256=2NT8djBgcovcYu3ttVecdDhhDZit6vnMyAtm_HsFuHQ,1648
12
+ singlestoredb/__init__.py,sha256=BbJxfn3xD6sghrcCqD-i8zh4_bZwrvLSoYVPLvAhTSo,1649
13
13
  singlestoredb/types.py,sha256=FIqO1A7e0Gkk7ITmIysBy-P5S--ItbMSlYvblzqGS30,9969
14
14
  singlestoredb/connection.py,sha256=PlOD-4Qx3Q-lVPPdjru-kTC8kOWDos3eiWVo7pPKeKM,45679
15
15
  singlestoredb/pytest.py,sha256=OyF3BO9mgxenifYhOihnzGk8WzCJ_zN5_mxe8XyFPOc,9074
@@ -17,14 +17,14 @@ singlestoredb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  singlestoredb/exceptions.py,sha256=HuoA6sMRL5qiCiee-_5ddTGmFbYC9Euk8TYUsh5GvTw,3234
18
18
  singlestoredb/converters.py,sha256=t1hRMZfccWJs_WyOw-W-Kh87fxsOkpOnKXAeh_Nr-zU,20681
19
19
  singlestoredb/fusion/graphql.py,sha256=ZA3HcDq5rER-dCEavwTqnF7KM0D2LCYIY7nLQk7lSso,5207
20
- singlestoredb/fusion/handler.py,sha256=5DjY8bUf8x-d0kVr9mba_o0W5vLRFj5ImKk-on_UtYk,27607
20
+ singlestoredb/fusion/handler.py,sha256=HEW83De1zj94hvG7rbqlOszIIgBKiag0UGO5I0WoJ6A,27400
21
21
  singlestoredb/fusion/registry.py,sha256=jjdRTYZ3ylhy6gAoW5xBj0tkxGFBT-2yLQ0tztTgDIY,6112
22
22
  singlestoredb/fusion/__init__.py,sha256=Qo7SuqGw-l-vE8-EI2jhm6hXJkYfOLUKIws9c7LFNX0,356
23
23
  singlestoredb/fusion/result.py,sha256=Bd3KbRpqWqQcWp_Chd4bzBy8Kfc8nXLS_Pn_GGbPO6o,11772
24
24
  singlestoredb/fusion/handlers/files.py,sha256=c-QaWzgLGRMheFvG2uUeYfVgLA5WfSE3e9XeBrsFNh0,18979
25
25
  singlestoredb/fusion/handlers/job.py,sha256=r0KdOD55VUDw-SymC__5Mn-fzJTZE_xcBgH-O8DYVHc,21095
26
26
  singlestoredb/fusion/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- singlestoredb/fusion/handlers/export.py,sha256=GJ-tykXHK0iMNAvJrJvtrGCgRpRtlFwFt-e7hxKhp2U,6808
27
+ singlestoredb/fusion/handlers/export.py,sha256=mnt2ZsmOzd7x8YHVMXtYdbtD0KvOzAngysyTwQz1x8w,6948
28
28
  singlestoredb/fusion/handlers/utils.py,sha256=yXggiwnKq7IrCFXQwY-ZNc8gHxvftUUq4NXc8LCP7eM,10046
29
29
  singlestoredb/fusion/handlers/stage.py,sha256=kYVjbPys83kf3jX6jWwN8Ju0oEocKVZ3TIOt2HiC5Ew,14287
30
30
  singlestoredb/fusion/handlers/workspace.py,sha256=4xN2TFO4yF7KZB2Fcht7IuvoDdAT6fDfDLjixiHZN8w,27506
@@ -52,16 +52,19 @@ singlestoredb/tests/test.ipynb,sha256=jrkI2WoSsUA9xQpKTBCHnsDptryQhPdM5QaxfvYRGp
52
52
  singlestoredb/tests/test_types.py,sha256=jqoAaSjhbgwB3vt0KsTcl7XBWoMMIa0mPFKhEi5bBjo,4500
53
53
  singlestoredb/tests/test2.sql,sha256=D4U2GSlOVeo39U8-RMM4YziJzYFfi4Ztm2YXJVJVAS8,37
54
54
  singlestoredb/tests/ext_funcs/__init__.py,sha256=qZLnDI_Ck0tguVi-K-BKXDHAcC0jui3dsm93Djj4x08,9290
55
- singlestoredb/management/files.py,sha256=AwqcYn1x0uWKzV_RYQgcpSRcMblPP5jKvgcmesyCP00,28166
55
+ singlestoredb/magics/__init__.py,sha256=lZjkT3Webo9c1EQAzlRCRh6B2pckQH8uvNrrB__abcI,1210
56
+ singlestoredb/magics/run_shared.py,sha256=SI8dCBRMaGn-xZU7dto4jsAqKBi-Ll14htUsMUSBpJM,1752
57
+ singlestoredb/magics/run_personal.py,sha256=2f7u1T7iblxGzZurHNgNXLrPBvsvPADZKo_RD_IjYuE,1844
58
+ singlestoredb/management/files.py,sha256=nig1XmTsDMN-0PToG0N80KsNiOoHwJhFwG1GNHNxWvU,28217
56
59
  singlestoredb/management/organization.py,sha256=hqMaM7H-naMjNbxDl_f7G_2o5TkiGKyzPhxuzDveJAw,5402
57
60
  singlestoredb/management/job.py,sha256=4-xLWzbE8odQogVVaFer80UEoTAZY1T28VZ9Ug4rbmM,24611
58
61
  singlestoredb/management/region.py,sha256=HnLcWUh7r_aLECliplCDHak4a_F3B7LOSXEYMW66qD0,1611
59
62
  singlestoredb/management/__init__.py,sha256=ofNTPCdkZ1dS_aX2aUujd8aMHQi8Lle5Ced0aaO3RH4,269
60
63
  singlestoredb/management/export.py,sha256=_kr5grRVFe0RGuk_XoDGYq_4VXMvGCWvkan9dZO-jGA,4156
61
64
  singlestoredb/management/utils.py,sha256=P4fp8a7EwaYiag_hvpILcgwXtdFNYKKO70dsKjmxn1A,13171
62
- singlestoredb/management/cluster.py,sha256=i23Smr1PBrDZ8NO_VPd_-bEYkyHvVe9CCRGUjHn_1yQ,14362
63
- singlestoredb/management/workspace.py,sha256=MdVuCxNv6C1QgiT-1V8kqZeWLeOYWnnDSYMUvj7EtRU,56268
64
- singlestoredb/management/manager.py,sha256=sFP1vZGS8WpN8E0XLu1N7Mxtq6Sixalln44HlTQEyXI,8800
65
+ singlestoredb/management/cluster.py,sha256=h75grXSxq4Anr4RxwKxcZW4TkWJ4bFg_ql5iRWCNLdQ,14405
66
+ singlestoredb/management/workspace.py,sha256=fNUiz3XNTGgXdOACsQz56Gox2qt9lOVGAtHK67IpMuc,56319
67
+ singlestoredb/management/manager.py,sha256=X29VEHlUEzmWvGo_bQMzo8a6d4nYMLE1CewlNBjrD7M,8851
65
68
  singlestoredb/management/billing_usage.py,sha256=9ighjIpcopgIyJOktBYQ6pahBZmWGHOPyyCW4gu9FGs,3735
66
69
  singlestoredb/utils/config.py,sha256=m3Xn6hsbdKyLufSnbokhFJ9Vfaz9Qpkj1IEnIiH9oJQ,24503
67
70
  singlestoredb/utils/results.py,sha256=bJtaUaDiFq26IsPAKZ2FHGB7csMn94EAxLKrP4HaEEA,15277