singlestoredb 1.9.0__tar.gz → 1.10.0__tar.gz

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.

Files changed (150) hide show
  1. {singlestoredb-1.9.0/singlestoredb.egg-info → singlestoredb-1.10.0}/PKG-INFO +1 -1
  2. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/setup.cfg +1 -1
  3. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/__init__.py +1 -1
  4. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/handler.py +0 -7
  5. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/handlers/export.py +11 -7
  6. singlestoredb-1.10.0/singlestoredb/magics/__init__.py +34 -0
  7. singlestoredb-1.10.0/singlestoredb/magics/run_personal.py +56 -0
  8. singlestoredb-1.10.0/singlestoredb/magics/run_shared.py +53 -0
  9. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/cluster.py +2 -1
  10. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/files.py +3 -2
  11. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/manager.py +3 -2
  12. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/workspace.py +3 -2
  13. {singlestoredb-1.9.0 → singlestoredb-1.10.0/singlestoredb.egg-info}/PKG-INFO +1 -1
  14. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb.egg-info/SOURCES.txt +3 -0
  15. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/LICENSE +0 -0
  16. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/README.md +0 -0
  17. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/accel.c +0 -0
  18. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/setup.py +0 -0
  19. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/ai/__init__.py +0 -0
  20. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/ai/embeddings.py +0 -0
  21. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/alchemy/__init__.py +0 -0
  22. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/apps/__init__.py +0 -0
  23. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/apps/_cloud_functions.py +0 -0
  24. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/apps/_config.py +0 -0
  25. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/apps/_connection_info.py +0 -0
  26. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/apps/_dashboards.py +0 -0
  27. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/apps/_process.py +0 -0
  28. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/apps/_stdout_supress.py +0 -0
  29. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/apps/_uvicorn_util.py +0 -0
  30. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/auth.py +0 -0
  31. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/config.py +0 -0
  32. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/connection.py +0 -0
  33. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/converters.py +0 -0
  34. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/exceptions.py +0 -0
  35. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/__init__.py +0 -0
  36. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/decorator.py +0 -0
  37. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/dtypes.py +0 -0
  38. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/ext/__init__.py +0 -0
  39. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/ext/arrow.py +0 -0
  40. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/ext/asgi.py +0 -0
  41. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/ext/json.py +0 -0
  42. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/ext/mmap.py +0 -0
  43. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/ext/rowdat_1.py +0 -0
  44. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/ext/utils.py +0 -0
  45. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/functions/signature.py +0 -0
  46. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/__init__.py +0 -0
  47. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/graphql.py +0 -0
  48. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/handlers/__init__.py +0 -0
  49. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/handlers/files.py +0 -0
  50. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/handlers/job.py +0 -0
  51. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/handlers/stage.py +0 -0
  52. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/handlers/utils.py +0 -0
  53. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/handlers/workspace.py +0 -0
  54. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/registry.py +0 -0
  55. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/fusion/result.py +0 -0
  56. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/http/__init__.py +0 -0
  57. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/http/connection.py +0 -0
  58. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/__init__.py +0 -0
  59. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/billing_usage.py +0 -0
  60. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/export.py +0 -0
  61. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/job.py +0 -0
  62. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/organization.py +0 -0
  63. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/region.py +0 -0
  64. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/management/utils.py +0 -0
  65. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/__init__.py +0 -0
  66. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/_auth.py +0 -0
  67. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/charset.py +0 -0
  68. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/connection.py +0 -0
  69. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/CLIENT.py +0 -0
  70. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/COMMAND.py +0 -0
  71. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/CR.py +0 -0
  72. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/ER.py +0 -0
  73. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/EXTENDED_TYPE.py +0 -0
  74. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/FIELD_TYPE.py +0 -0
  75. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/FLAG.py +0 -0
  76. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/SERVER_STATUS.py +0 -0
  77. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/VECTOR_TYPE.py +0 -0
  78. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/constants/__init__.py +0 -0
  79. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/converters.py +0 -0
  80. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/cursors.py +0 -0
  81. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/err.py +0 -0
  82. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/optionfile.py +0 -0
  83. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/protocol.py +0 -0
  84. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/__init__.py +0 -0
  85. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/base.py +0 -0
  86. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/conftest.py +0 -0
  87. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_DictCursor.py +0 -0
  88. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_SSCursor.py +0 -0
  89. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_basic.py +0 -0
  90. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_connection.py +0 -0
  91. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_converters.py +0 -0
  92. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_cursor.py +0 -0
  93. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_err.py +0 -0
  94. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_issues.py +0 -0
  95. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_load_local.py +0 -0
  96. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_nextset.py +0 -0
  97. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/test_optionfile.py +0 -0
  98. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/thirdparty/__init__.py +0 -0
  99. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/__init__.py +0 -0
  100. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/capabilities.py +0 -0
  101. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/dbapi20.py +0 -0
  102. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py +0 -0
  103. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py +0 -0
  104. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py +0 -0
  105. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/mysql/times.py +0 -0
  106. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/notebook/__init__.py +0 -0
  107. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/notebook/_objects.py +0 -0
  108. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/notebook/_portal.py +0 -0
  109. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/py.typed +0 -0
  110. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/pytest.py +0 -0
  111. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/__init__.py +0 -0
  112. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/empty.sql +0 -0
  113. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/ext_funcs/__init__.py +0 -0
  114. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/local_infile.csv +0 -0
  115. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test.ipynb +0 -0
  116. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test.sql +0 -0
  117. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test2.ipynb +0 -0
  118. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test2.sql +0 -0
  119. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_basics.py +0 -0
  120. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_config.py +0 -0
  121. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_connection.py +0 -0
  122. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_dbapi.py +0 -0
  123. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_exceptions.py +0 -0
  124. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_ext_func.py +0 -0
  125. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_ext_func_data.py +0 -0
  126. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_fusion.py +0 -0
  127. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_http.py +0 -0
  128. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_management.py +0 -0
  129. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_plugin.py +0 -0
  130. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_results.py +0 -0
  131. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_types.py +0 -0
  132. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_udf.py +0 -0
  133. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/test_xdict.py +0 -0
  134. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/tests/utils.py +0 -0
  135. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/types.py +0 -0
  136. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/__init__.py +0 -0
  137. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/config.py +0 -0
  138. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/convert_rows.py +0 -0
  139. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/debug.py +0 -0
  140. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/dtypes.py +0 -0
  141. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/events.py +0 -0
  142. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/mogrify.py +0 -0
  143. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/results.py +0 -0
  144. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb/utils/xdict.py +0 -0
  145. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb.egg-info/dependency_links.txt +0 -0
  146. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb.egg-info/entry_points.txt +0 -0
  147. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb.egg-info/requires.txt +0 -0
  148. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/singlestoredb.egg-info/top_level.txt +0 -0
  149. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/sqlx/__init__.py +0 -0
  150. {singlestoredb-1.9.0 → singlestoredb-1.10.0}/sqlx/magic.py +0 -0
@@ -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,6 +1,6 @@
1
1
  [metadata]
2
2
  name = singlestoredb
3
- version = 1.9.0
3
+ version = 1.10.0
4
4
  description = Interface to the SingleStoreDB database and workspace management APIs
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
@@ -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
@@ -54,6 +54,9 @@ singlestoredb/fusion/handlers/utils.py
54
54
  singlestoredb/fusion/handlers/workspace.py
55
55
  singlestoredb/http/__init__.py
56
56
  singlestoredb/http/connection.py
57
+ singlestoredb/magics/__init__.py
58
+ singlestoredb/magics/run_personal.py
59
+ singlestoredb/magics/run_shared.py
57
60
  singlestoredb/management/__init__.py
58
61
  singlestoredb/management/billing_usage.py
59
62
  singlestoredb/management/cluster.py
File without changes
File without changes
File without changes
File without changes