We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d66632f commit 83a6683Copy full SHA for 83a6683
singlestoredb/apps/_python_udfs.py
@@ -13,6 +13,8 @@
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
async def run_udf_app(
20
log_level: str = 'error',
@@ -46,6 +48,11 @@ async def run_udf_app(
46
48
udf_suffix = '_test'
47
49
app = Application(url=base_url, app_mode='managed', name_suffix=udf_suffix)
50
51
+ if not app.endpoints:
52
+ raise ValueError("You must define at least one function.")
53
+ if len(app.endpoints) > MAX_UDFS_LIMIT:
54
+ raise ValueError(f"You can only define a maximum of {MAX_UDFS_LIMIT} functions.")
55
+
56
config = uvicorn.Config(
57
app,
58
host='0.0.0.0',
0 commit comments