Skip to content

Commit a18eb52

Browse files
kesmit13claude
andcommitted
Remove WASM numpy_stub, now unnecessary with lazy imports
numpy is lazy-loaded throughout the codebase via the _lazy_import helpers, so the WASM numpy_stub that patched sys.modules['numpy'] is no longer needed. Delete the stub module and remove its references from udf_handler.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0e4bb40 commit a18eb52

File tree

2 files changed

+3
-139
lines changed

2 files changed

+3
-139
lines changed

singlestoredb/functions/ext/wasm/numpy_stub.py

Lines changed: 0 additions & 127 deletions
This file was deleted.

singlestoredb/functions/ext/wasm/udf_handler.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,9 @@
2424
from typing import List
2525
from typing import Optional
2626

27-
28-
# Install numpy stub before importing singlestoredb (which tries to import numpy)
29-
if 'numpy' not in sys.modules:
30-
try:
31-
import numpy # noqa: F401
32-
except ImportError:
33-
from . import numpy_stub
34-
sys.modules['numpy'] = numpy_stub
35-
36-
from singlestoredb.functions.signature import get_signature
37-
from singlestoredb.functions.ext.rowdat_1 import load as _load_rowdat_1
3827
from singlestoredb.functions.ext.rowdat_1 import dump as _dump_rowdat_1
28+
from singlestoredb.functions.ext.rowdat_1 import load as _load_rowdat_1
29+
from singlestoredb.functions.signature import get_signature
3930
from singlestoredb.mysql.constants import FIELD_TYPE as ft
4031

4132
try:
@@ -144,7 +135,7 @@ def _is_stdlib_or_infra(mod_name: str, mod_file: str) -> bool:
144135
"""
145136
# Infrastructure modules that are part of this project
146137
_infra = frozenset({
147-
'udf_handler', 'numpy_stub',
138+
'udf_handler',
148139
})
149140
if mod_name in _infra:
150141
return True

0 commit comments

Comments
 (0)