Skip to content

Commit 67fdc80

Browse files
authored
Refactor UDF server and external function type system (#57)
* Refactoring function signatures * Refactor return values * Fix UDF return values * Big refactoring of the way parameters / return values work * Add default values from pydantic / namedtuple / etc * Fix TypedDict defaults * Disable lifespan in uvicorn * Fix multiple vector output in TVFs; fix ucs4 to utf8 transcoding in numpy fixed strings * Remove debugging code * Fix masked types; add asgi endpoint for function info * Fix get_annotations call * Fix imports; change binary from hex to base64 * Fix show functions call * Fix fixed length strings / binary; add tests for fixed strings / binary; test no args / no return value * Add vector type * Fix fixed length binary values
1 parent 4bd8c89 commit 67fdc80

File tree

15 files changed

+2690
-1080
lines changed

15 files changed

+2690
-1080
lines changed

accel.c

Lines changed: 201 additions & 37 deletions
Large diffs are not rendered by default.

singlestoredb/config.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,18 @@
407407
environ=['SINGLESTOREDB_EXT_FUNC_LOG_LEVEL'],
408408
)
409409

410+
register_option(
411+
'external_function.name_prefix', 'string', check_str, '',
412+
'Prefix to add to external function names.',
413+
environ=['SINGLESTOREDB_EXT_FUNC_NAME_PREFIX'],
414+
)
415+
416+
register_option(
417+
'external_function.name_suffix', 'string', check_str, '',
418+
'Suffix to add to external function names.',
419+
environ=['SINGLESTOREDB_EXT_FUNC_NAME_SUFFIX'],
420+
)
421+
410422
register_option(
411423
'external_function.connection', 'string', check_str,
412424
os.environ.get('SINGLESTOREDB_URL') or None,
@@ -415,7 +427,7 @@
415427
)
416428

417429
register_option(
418-
'external_function.host', 'string', check_str, '127.0.0.1',
430+
'external_function.host', 'string', check_str, 'localhost',
419431
'Specifies the host to bind the server to.',
420432
environ=['SINGLESTOREDB_EXT_FUNC_HOST'],
421433
)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
from .decorator import tvf # noqa: F401
2+
from .decorator import tvf_with_null_masks # noqa: F401
23
from .decorator import udf # noqa: F401
4+
from .decorator import udf_with_null_masks # noqa: F401
5+
from .typing import Masked # noqa: F401
6+
from .typing import MaskedNDArray # noqa: F401

0 commit comments

Comments
 (0)