Skip to content

Commit 24df239

Browse files
kesmit13claude
andcommitted
Fix Python 3.10+ union syntax in udf_handler type annotation
Replace `str | None` with `Optional[str]` to maintain compatibility with Python 3.9 and earlier. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent aed95df commit 24df239

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

singlestoredb/functions/ext/wasm/udf_handler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from typing import Callable
2323
from typing import Dict
2424
from typing import List
25+
from typing import Optional
2526

2627

2728
# Install numpy stub before importing singlestoredb (which tries to import numpy)
@@ -58,7 +59,7 @@ class _TracingFormatter(logging.Formatter):
5859
'CRITICAL': '\033[31m', # red
5960
}
6061

61-
def formatTime(self, record: logging.LogRecord, datefmt: str | None = None) -> str:
62+
def formatTime(self, record: logging.LogRecord, datefmt: Optional[str] = None) -> str:
6263
from datetime import datetime, timezone
6364
dt = datetime.fromtimestamp(record.created, tz=timezone.utc)
6465
return dt.strftime('%Y-%m-%dT%H:%M:%S.') + f'{dt.microsecond:06d}Z'

0 commit comments

Comments
 (0)