singlestoredb 1.14.1__tar.gz → 1.15.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.
- {singlestoredb-1.14.1/singlestoredb.egg-info → singlestoredb-1.15.0}/PKG-INFO +2 -1
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/setup.cfg +3 -2
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/__init__.py +14 -10
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/_python_udfs.py +3 -3
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/config.py +5 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/decorator.py +32 -13
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/ext/asgi.py +287 -27
- singlestoredb-1.15.0/singlestoredb/functions/ext/timer.py +98 -0
- singlestoredb-1.15.0/singlestoredb/functions/typing/numpy.py +20 -0
- singlestoredb-1.15.0/singlestoredb/functions/typing/pandas.py +2 -0
- singlestoredb-1.15.0/singlestoredb/functions/typing/polars.py +2 -0
- singlestoredb-1.15.0/singlestoredb/functions/typing/pyarrow.py +2 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handler.py +17 -4
- singlestoredb-1.15.0/singlestoredb/magics/run_personal.py +137 -0
- singlestoredb-1.15.0/singlestoredb/magics/run_shared.py +134 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/__init__.py +1 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/export.py +1 -1
- singlestoredb-1.15.0/singlestoredb/management/region.py +159 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/workspace.py +180 -1
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/ext_funcs/__init__.py +94 -55
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test.sql +22 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_ext_func.py +90 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_fusion.py +4 -1
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_management.py +253 -20
- {singlestoredb-1.14.1 → singlestoredb-1.15.0/singlestoredb.egg-info}/PKG-INFO +2 -1
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb.egg-info/SOURCES.txt +6 -1
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb.egg-info/requires.txt +3 -1
- singlestoredb-1.14.1/singlestoredb/magics/run_personal.py +0 -56
- singlestoredb-1.14.1/singlestoredb/magics/run_shared.py +0 -53
- singlestoredb-1.14.1/singlestoredb/management/region.py +0 -67
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/LICENSE +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/README.md +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/accel.c +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/setup.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/ai/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/ai/chat.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/ai/embeddings.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/alchemy/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/_cloud_functions.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/_config.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/_connection_info.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/_dashboards.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/_process.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/_stdout_supress.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/apps/_uvicorn_util.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/auth.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/connection.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/converters.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/exceptions.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/dtypes.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/ext/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/ext/arrow.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/ext/json.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/ext/mmap.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/ext/rowdat_1.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/ext/utils.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/signature.py +0 -0
- /singlestoredb-1.14.1/singlestoredb/functions/typing.py → /singlestoredb-1.15.0/singlestoredb/functions/typing/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/functions/utils.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/graphql.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handlers/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handlers/export.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handlers/files.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handlers/job.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handlers/models.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handlers/stage.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handlers/utils.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/handlers/workspace.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/registry.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/fusion/result.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/http/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/http/connection.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/magics/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/billing_usage.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/cluster.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/files.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/inference_api.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/job.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/manager.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/organization.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/management/utils.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/_auth.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/charset.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/connection.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/CLIENT.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/COMMAND.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/CR.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/ER.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/EXTENDED_TYPE.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/FIELD_TYPE.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/FLAG.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/SERVER_STATUS.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/VECTOR_TYPE.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/constants/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/converters.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/cursors.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/err.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/optionfile.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/protocol.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/base.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/conftest.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_DictCursor.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_SSCursor.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_basic.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_connection.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_converters.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_cursor.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_err.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_issues.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_load_local.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_nextset.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/test_optionfile.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/thirdparty/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/capabilities.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/dbapi20.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/mysql/times.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/notebook/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/notebook/_objects.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/notebook/_portal.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/py.typed +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/pytest.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/server/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/server/docker.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/server/free_tier.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/empty.sql +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/local_infile.csv +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test.ipynb +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test2.ipynb +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test2.sql +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_basics.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_config.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_connection.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_dbapi.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_exceptions.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_ext_func_data.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_http.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_plugin.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_results.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_types.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_udf.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_udf_returns.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_vectorstore.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/test_xdict.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/tests/utils.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/types.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/config.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/convert_rows.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/debug.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/dtypes.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/events.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/mogrify.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/results.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/utils/xdict.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb/vectorstore.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb.egg-info/dependency_links.txt +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb.egg-info/entry_points.txt +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/singlestoredb.egg-info/top_level.txt +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/sqlx/__init__.py +0 -0
- {singlestoredb-1.14.1 → singlestoredb-1.15.0}/sqlx/magic.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: singlestoredb
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.15.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
|
|
@@ -23,6 +23,7 @@ Provides-Extra: kerberos
|
|
|
23
23
|
Provides-Extra: pytest
|
|
24
24
|
Provides-Extra: rsa
|
|
25
25
|
Provides-Extra: sqlalchemy
|
|
26
|
+
Provides-Extra: vectorstore
|
|
26
27
|
License-File: LICENSE
|
|
27
28
|
|
|
28
29
|
# <img src="https://github.com/singlestore-labs/singlestoredb-python/blob/main/resources/singlestore-logo.png" height="60" valign="middle"/> SingleStoreDB Python SDK
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = singlestoredb
|
|
3
|
-
version = 1.
|
|
3
|
+
version = 1.15.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
|
|
@@ -24,7 +24,6 @@ install_requires =
|
|
|
24
24
|
parsimonious
|
|
25
25
|
requests
|
|
26
26
|
setuptools
|
|
27
|
-
singlestore-vectorstore>=0.1.2
|
|
28
27
|
sqlparams
|
|
29
28
|
wheel
|
|
30
29
|
tomli>=1.1.0;python_version < '3.11'
|
|
@@ -68,6 +67,8 @@ rsa =
|
|
|
68
67
|
cryptography
|
|
69
68
|
sqlalchemy =
|
|
70
69
|
sqlalchemy-singlestoredb>=1.0.0
|
|
70
|
+
vectorstore =
|
|
71
|
+
singlestore-vectorstore>=0.1.2
|
|
71
72
|
|
|
72
73
|
[options.package_data]
|
|
73
74
|
* =
|
|
@@ -13,7 +13,7 @@ Examples
|
|
|
13
13
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
__version__ = '1.
|
|
16
|
+
__version__ = '1.15.0'
|
|
17
17
|
|
|
18
18
|
from typing import Any
|
|
19
19
|
|
|
@@ -25,20 +25,24 @@ from .exceptions import (
|
|
|
25
25
|
DataError, ManagementError,
|
|
26
26
|
)
|
|
27
27
|
from .management import (
|
|
28
|
-
manage_cluster, manage_workspaces, manage_files,
|
|
28
|
+
manage_cluster, manage_workspaces, manage_files, manage_regions,
|
|
29
29
|
)
|
|
30
30
|
from .types import (
|
|
31
31
|
Date, Time, Timestamp, DateFromTicks, TimeFromTicks, TimestampFromTicks,
|
|
32
32
|
Binary, STRING, BINARY, NUMBER, DATETIME, ROWID,
|
|
33
33
|
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
# These are only loaded if the singlestore-vectorstore package is available
|
|
35
|
+
try:
|
|
36
|
+
from .vectorstore import (
|
|
37
|
+
vector_db, IndexInterface, IndexList, IndexModel, MatchTypedDict,
|
|
38
|
+
Metric, IndexStatsTypedDict, NamespaceStatsTypedDict, Vector,
|
|
39
|
+
VectorDictMetadataValue, VectorMetadataTypedDict, VectorTuple,
|
|
40
|
+
VectorTupleWithMetadata, DeletionProtection, AndFilter, EqFilter,
|
|
41
|
+
ExactMatchFilter, FilterTypedDict, GteFilter, GtFilter, InFilter,
|
|
42
|
+
LteFilter, LtFilter, NeFilter, NinFilter, OrFilter, SimpleFilter,
|
|
43
|
+
)
|
|
44
|
+
except (ImportError, ModuleNotFoundError):
|
|
45
|
+
pass
|
|
42
46
|
|
|
43
47
|
|
|
44
48
|
#
|
|
@@ -15,7 +15,6 @@ _running_server: 'typing.Optional[AwaitableUvicornServer]' = None
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
async def run_udf_app(
|
|
18
|
-
replace_existing: bool,
|
|
19
18
|
log_level: str = 'error',
|
|
20
19
|
kill_existing_app_server: bool = True,
|
|
21
20
|
) -> UdfConnectionInfo:
|
|
@@ -55,8 +54,9 @@ async def run_udf_app(
|
|
|
55
54
|
)
|
|
56
55
|
_running_server = AwaitableUvicornServer(config)
|
|
57
56
|
|
|
58
|
-
# Register the functions
|
|
59
|
-
|
|
57
|
+
# Register the functions only if the app is running interactively.
|
|
58
|
+
if app_config.running_interactively:
|
|
59
|
+
app.register_functions(replace=True)
|
|
60
60
|
|
|
61
61
|
asyncio.create_task(_running_server.serve())
|
|
62
62
|
await _running_server.wait_for_startup()
|
|
@@ -438,6 +438,11 @@ register_option(
|
|
|
438
438
|
environ=['SINGLESTOREDB_EXT_FUNC_PORT'],
|
|
439
439
|
)
|
|
440
440
|
|
|
441
|
+
register_option(
|
|
442
|
+
'external_function.timeout', 'int', check_int, 24*60*60,
|
|
443
|
+
'Specifies the timeout in seconds for processing a batch of rows.',
|
|
444
|
+
environ=['SINGLESTOREDB_EXT_FUNC_TIMEOUT'],
|
|
445
|
+
)
|
|
441
446
|
|
|
442
447
|
#
|
|
443
448
|
# Debugging options
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import asyncio
|
|
1
2
|
import functools
|
|
2
3
|
import inspect
|
|
3
4
|
from typing import Any
|
|
@@ -19,6 +20,7 @@ ParameterType = Union[
|
|
|
19
20
|
]
|
|
20
21
|
|
|
21
22
|
ReturnType = ParameterType
|
|
23
|
+
UDFType = Callable[..., Any]
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
def is_valid_type(obj: Any) -> bool:
|
|
@@ -100,7 +102,8 @@ def _func(
|
|
|
100
102
|
name: Optional[str] = None,
|
|
101
103
|
args: Optional[ParameterType] = None,
|
|
102
104
|
returns: Optional[ReturnType] = None,
|
|
103
|
-
|
|
105
|
+
timeout: Optional[int] = None,
|
|
106
|
+
) -> UDFType:
|
|
104
107
|
"""Generic wrapper for UDF and TVF decorators."""
|
|
105
108
|
|
|
106
109
|
_singlestoredb_attrs = { # type: ignore
|
|
@@ -108,6 +111,7 @@ def _func(
|
|
|
108
111
|
name=name,
|
|
109
112
|
args=expand_types(args),
|
|
110
113
|
returns=expand_types(returns),
|
|
114
|
+
timeout=timeout,
|
|
111
115
|
).items() if v is not None
|
|
112
116
|
}
|
|
113
117
|
|
|
@@ -115,23 +119,33 @@ def _func(
|
|
|
115
119
|
# called later, so the wrapper much be created with the func passed
|
|
116
120
|
# in at that time.
|
|
117
121
|
if func is None:
|
|
118
|
-
def decorate(func:
|
|
122
|
+
def decorate(func: UDFType) -> UDFType:
|
|
119
123
|
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
if asyncio.iscoroutinefunction(func):
|
|
125
|
+
async def async_wrapper(*args: Any, **kwargs: Any) -> UDFType:
|
|
126
|
+
return await func(*args, **kwargs) # type: ignore
|
|
127
|
+
async_wrapper._singlestoredb_attrs = _singlestoredb_attrs # type: ignore
|
|
128
|
+
return functools.wraps(func)(async_wrapper)
|
|
122
129
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
else:
|
|
131
|
+
def wrapper(*args: Any, **kwargs: Any) -> UDFType:
|
|
132
|
+
return func(*args, **kwargs) # type: ignore
|
|
133
|
+
wrapper._singlestoredb_attrs = _singlestoredb_attrs # type: ignore
|
|
134
|
+
return functools.wraps(func)(wrapper)
|
|
126
135
|
|
|
127
136
|
return decorate
|
|
128
137
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
if asyncio.iscoroutinefunction(func):
|
|
139
|
+
async def async_wrapper(*args: Any, **kwargs: Any) -> UDFType:
|
|
140
|
+
return await func(*args, **kwargs) # type: ignore
|
|
141
|
+
async_wrapper._singlestoredb_attrs = _singlestoredb_attrs # type: ignore
|
|
142
|
+
return functools.wraps(func)(async_wrapper)
|
|
133
143
|
|
|
134
|
-
|
|
144
|
+
else:
|
|
145
|
+
def wrapper(*args: Any, **kwargs: Any) -> UDFType:
|
|
146
|
+
return func(*args, **kwargs) # type: ignore
|
|
147
|
+
wrapper._singlestoredb_attrs = _singlestoredb_attrs # type: ignore
|
|
148
|
+
return functools.wraps(func)(wrapper)
|
|
135
149
|
|
|
136
150
|
|
|
137
151
|
def udf(
|
|
@@ -140,7 +154,8 @@ def udf(
|
|
|
140
154
|
name: Optional[str] = None,
|
|
141
155
|
args: Optional[ParameterType] = None,
|
|
142
156
|
returns: Optional[ReturnType] = None,
|
|
143
|
-
|
|
157
|
+
timeout: Optional[int] = None,
|
|
158
|
+
) -> UDFType:
|
|
144
159
|
"""
|
|
145
160
|
Define a user-defined function (UDF).
|
|
146
161
|
|
|
@@ -167,6 +182,9 @@ def udf(
|
|
|
167
182
|
Specifies the return data type of the function. This parameter
|
|
168
183
|
works the same way as `args`. If the function is a table-valued
|
|
169
184
|
function, the return type should be a `Table` object.
|
|
185
|
+
timeout : int, optional
|
|
186
|
+
The timeout in seconds for the UDF execution. If not specified,
|
|
187
|
+
the global default timeout is used.
|
|
170
188
|
|
|
171
189
|
Returns
|
|
172
190
|
-------
|
|
@@ -178,4 +196,5 @@ def udf(
|
|
|
178
196
|
name=name,
|
|
179
197
|
args=args,
|
|
180
198
|
returns=returns,
|
|
199
|
+
timeout=timeout,
|
|
181
200
|
)
|