Tags: singlestore-labs/singlestoredb-python
Tags
embeddings: restore self-chunking for non-OpenAI models Re-add _ChunkedOpenAIEmbeddings: for non-Azure models (e.g. Qwen on 'Nova'), send raw text (check_embedding_ctx_length=False) and split long inputs into character-bounded chunks, embedding each and length-weighted-averaging into one vector per input, so long texts never hit the server's context limit. Azure keeps tiktoken (True). Co-authored-by: Cursor <cursoragent@cursor.com>
Fix four correctness and robustness issues - connection.py: coerce scalar rows to 1-tuple in _iquery() numpy path so single-column structured ndarrays don't break zip(names, row). - json.py: use integer arithmetic (days/seconds/microseconds) instead of float total_seconds() for timedelta serialization to avoid precision loss on large durations. - registry.py: guard numpy import in _normalize_vector_output() behind try/except ImportError so non-numpy environments (WASM) can still use vector formats like 'list'. - server.py: use pre-allocated bytearray in _read_pipe_message() to avoid quadratic copying, and enforce a 16 MiB size cap to prevent unbounded memory growth from malformed length prefixes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add PEP 440 pre-release version patching to publish workflow Parses git tag suffixes (-test, -alpha, -beta, -rc) and patches pyproject.toml with the corresponding PEP 440 version before building wheels. Full releases (no suffix) are unaffected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix event loop closed error and add comprehensive UDF dispatch tests Replace asyncio.run() with _run_with_graceful_shutdown() that drains pending callbacks before closing the loop, preventing RuntimeError from httpx/anyio TLS cleanup in async UDFs calling OpenAI/LangChain APIs. Add 17 unit tests covering graceful shutdown, cancellation timing, exception propagation, context variable isolation, and concurrent safety. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add cancellable wrapper for responsive async UDF cancellation Wraps the inner coroutine in _cancellable_run which polls cancel_event and raises CancelledError at the next await (~100ms), ensuring vector UDFs respect disconnect/timeout signals without waiting for completion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use thread-per-request for async UDFs instead of shared event loop The dedicated shared event loop still caused starvation under concurrent async UDF calls. Switch to the same model used by sync UDFs: each request gets its own thread with asyncio.run(), eliminating loop contention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PreviousNext