singlestoredb 1.9.0__py3-none-any.whl → 1.10.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.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,4 +1,4 @@
1
- singlestoredb/__init__.py,sha256=2NT8djBgcovcYu3ttVecdDhhDZit6vnMyAtm_HsFuHQ,1648
1
+ singlestoredb/__init__.py,sha256=BbJxfn3xD6sghrcCqD-i8zh4_bZwrvLSoYVPLvAhTSo,1649
2
2
  singlestoredb/auth.py,sha256=u8D9tpKzrqa4ssaHjyZnGDX1q8XBpGtuoOkTkSv7B28,7599
3
3
  singlestoredb/config.py,sha256=ZGmnG37Ug1hT5jdTSdMJBCGDvvz2GwxrZZ_ROVV2wUE,12439
4
4
  singlestoredb/connection.py,sha256=PlOD-4Qx3Q-lVPPdjru-kTC8kOWDos3eiWVo7pPKeKM,45679
@@ -31,11 +31,11 @@ singlestoredb/functions/ext/rowdat_1.py,sha256=JgKRsVSQYczFD6cmo2xLilbNPYpyLL2tP
31
31
  singlestoredb/functions/ext/utils.py,sha256=2-B8YU_Iekv8JcpI-ochs9TIeuyatLaLAH-AyYyUUIg,5311
32
32
  singlestoredb/fusion/__init__.py,sha256=Qo7SuqGw-l-vE8-EI2jhm6hXJkYfOLUKIws9c7LFNX0,356
33
33
  singlestoredb/fusion/graphql.py,sha256=ZA3HcDq5rER-dCEavwTqnF7KM0D2LCYIY7nLQk7lSso,5207
34
- singlestoredb/fusion/handler.py,sha256=5DjY8bUf8x-d0kVr9mba_o0W5vLRFj5ImKk-on_UtYk,27607
34
+ singlestoredb/fusion/handler.py,sha256=HEW83De1zj94hvG7rbqlOszIIgBKiag0UGO5I0WoJ6A,27400
35
35
  singlestoredb/fusion/registry.py,sha256=jjdRTYZ3ylhy6gAoW5xBj0tkxGFBT-2yLQ0tztTgDIY,6112
36
36
  singlestoredb/fusion/result.py,sha256=Bd3KbRpqWqQcWp_Chd4bzBy8Kfc8nXLS_Pn_GGbPO6o,11772
37
37
  singlestoredb/fusion/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- singlestoredb/fusion/handlers/export.py,sha256=GJ-tykXHK0iMNAvJrJvtrGCgRpRtlFwFt-e7hxKhp2U,6808
38
+ singlestoredb/fusion/handlers/export.py,sha256=mnt2ZsmOzd7x8YHVMXtYdbtD0KvOzAngysyTwQz1x8w,6948
39
39
  singlestoredb/fusion/handlers/files.py,sha256=c-QaWzgLGRMheFvG2uUeYfVgLA5WfSE3e9XeBrsFNh0,18979
40
40
  singlestoredb/fusion/handlers/job.py,sha256=r0KdOD55VUDw-SymC__5Mn-fzJTZE_xcBgH-O8DYVHc,21095
41
41
  singlestoredb/fusion/handlers/stage.py,sha256=kYVjbPys83kf3jX6jWwN8Ju0oEocKVZ3TIOt2HiC5Ew,14287
@@ -43,17 +43,20 @@ singlestoredb/fusion/handlers/utils.py,sha256=yXggiwnKq7IrCFXQwY-ZNc8gHxvftUUq4N
43
43
  singlestoredb/fusion/handlers/workspace.py,sha256=4xN2TFO4yF7KZB2Fcht7IuvoDdAT6fDfDLjixiHZN8w,27506
44
44
  singlestoredb/http/__init__.py,sha256=A_2ZUCCpvRYIA6YDpPy57wL5R1eZ5SfP6I1To5nfJ2s,912
45
45
  singlestoredb/http/connection.py,sha256=dU0a72pMpyq9l9ADKs5jpB-GAJScBxgd83NOlGreIdc,39473
46
+ singlestoredb/magics/__init__.py,sha256=lZjkT3Webo9c1EQAzlRCRh6B2pckQH8uvNrrB__abcI,1210
47
+ singlestoredb/magics/run_personal.py,sha256=2f7u1T7iblxGzZurHNgNXLrPBvsvPADZKo_RD_IjYuE,1844
48
+ singlestoredb/magics/run_shared.py,sha256=SI8dCBRMaGn-xZU7dto4jsAqKBi-Ll14htUsMUSBpJM,1752
46
49
  singlestoredb/management/__init__.py,sha256=ofNTPCdkZ1dS_aX2aUujd8aMHQi8Lle5Ced0aaO3RH4,269
47
50
  singlestoredb/management/billing_usage.py,sha256=9ighjIpcopgIyJOktBYQ6pahBZmWGHOPyyCW4gu9FGs,3735
48
- singlestoredb/management/cluster.py,sha256=i23Smr1PBrDZ8NO_VPd_-bEYkyHvVe9CCRGUjHn_1yQ,14362
51
+ singlestoredb/management/cluster.py,sha256=h75grXSxq4Anr4RxwKxcZW4TkWJ4bFg_ql5iRWCNLdQ,14405
49
52
  singlestoredb/management/export.py,sha256=_kr5grRVFe0RGuk_XoDGYq_4VXMvGCWvkan9dZO-jGA,4156
50
- singlestoredb/management/files.py,sha256=AwqcYn1x0uWKzV_RYQgcpSRcMblPP5jKvgcmesyCP00,28166
53
+ singlestoredb/management/files.py,sha256=nig1XmTsDMN-0PToG0N80KsNiOoHwJhFwG1GNHNxWvU,28217
51
54
  singlestoredb/management/job.py,sha256=4-xLWzbE8odQogVVaFer80UEoTAZY1T28VZ9Ug4rbmM,24611
52
- singlestoredb/management/manager.py,sha256=sFP1vZGS8WpN8E0XLu1N7Mxtq6Sixalln44HlTQEyXI,8800
55
+ singlestoredb/management/manager.py,sha256=X29VEHlUEzmWvGo_bQMzo8a6d4nYMLE1CewlNBjrD7M,8851
53
56
  singlestoredb/management/organization.py,sha256=hqMaM7H-naMjNbxDl_f7G_2o5TkiGKyzPhxuzDveJAw,5402
54
57
  singlestoredb/management/region.py,sha256=HnLcWUh7r_aLECliplCDHak4a_F3B7LOSXEYMW66qD0,1611
55
58
  singlestoredb/management/utils.py,sha256=P4fp8a7EwaYiag_hvpILcgwXtdFNYKKO70dsKjmxn1A,13171
56
- singlestoredb/management/workspace.py,sha256=MdVuCxNv6C1QgiT-1V8kqZeWLeOYWnnDSYMUvj7EtRU,56268
59
+ singlestoredb/management/workspace.py,sha256=fNUiz3XNTGgXdOACsQz56Gox2qt9lOVGAtHK67IpMuc,56319
57
60
  singlestoredb/mysql/__init__.py,sha256=olUTAvkiERhDW41JXQMawkg-i0tvBEkoTkII1tt6lxU,4492
58
61
  singlestoredb/mysql/_auth.py,sha256=AugRitoUwgRIDFuJxuAH4MWIAmckY7Ji2pP6r_Ng9dY,8043
59
62
  singlestoredb/mysql/charset.py,sha256=-FlONDS_oAUF5B3mIgeHBPb_SCt4zHD33arUeBNctU0,10510
@@ -133,9 +136,9 @@ singlestoredb/utils/results.py,sha256=bJtaUaDiFq26IsPAKZ2FHGB7csMn94EAxLKrP4HaEE
133
136
  singlestoredb/utils/xdict.py,sha256=S9HKgrPrnu_6b7iOwa2KrW8CmU1Uqx0BWdEyogFzWbE,12896
134
137
  sqlx/__init__.py,sha256=aBYiU8DZXCogvWu3yWafOz7bZS5WWwLZXj7oL0dXGyU,85
135
138
  sqlx/magic.py,sha256=JsS9_9aBFaOt91Torm1JPN0c8qB2QmYJmNSKtbSQIY0,3509
136
- singlestoredb-1.9.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
137
- singlestoredb-1.9.0.dist-info/METADATA,sha256=gCoMBtMdsViRJC1mdvHhMjhKd0IleF7zYsg6LqfNSl0,5557
138
- singlestoredb-1.9.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
139
- singlestoredb-1.9.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
140
- singlestoredb-1.9.0.dist-info/top_level.txt,sha256=DfFGz7bM4XrshloiCeTABgylT3BUnS8T5pJam3ewT6Q,19
141
- singlestoredb-1.9.0.dist-info/RECORD,,
139
+ singlestoredb-1.10.0.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
140
+ singlestoredb-1.10.0.dist-info/METADATA,sha256=AJjDDzgSwAhjfE9TYRExsBssT0XuNEfi-btDUrTLpIA,5558
141
+ singlestoredb-1.10.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
142
+ singlestoredb-1.10.0.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
143
+ singlestoredb-1.10.0.dist-info/top_level.txt,sha256=DfFGz7bM4XrshloiCeTABgylT3BUnS8T5pJam3ewT6Q,19
144
+ singlestoredb-1.10.0.dist-info/RECORD,,