We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d66632f commit 3a83154Copy full SHA for 3a83154
singlestoredb/apps/_python_udfs.py
@@ -13,6 +13,9 @@
13
# Keep track of currently running server
14
_running_server: 'typing.Optional[AwaitableUvicornServer]' = None
15
16
+# Maximum number of UDFs allowed
17
+MAX_UDFS_LIMIT = 10
18
+
19
20
async def run_udf_app(
21
log_level: str = 'error',
@@ -46,6 +49,13 @@ async def run_udf_app(
46
49
udf_suffix = '_test'
47
50
app = Application(url=base_url, app_mode='managed', name_suffix=udf_suffix)
48
51
52
+ if not app.endpoints:
53
+ raise ValueError('You must define at least one function.')
54
+ if len(app.endpoints) > MAX_UDFS_LIMIT:
55
+ raise ValueError(
56
+ f'You can only define a maximum of {MAX_UDFS_LIMIT} functions.',
57
+ )
58
59
config = uvicorn.Config(
60
app,
61
host='0.0.0.0',
0 commit comments