Skip to content

Commit e342f5c

Browse files
rustyconoverclaude
andcommitted
Bump version to 0.1.14 and cast compatible stream input schemas
Cast compatible Arrow types (e.g., decimal→double, int32→int64) in stream input instead of rejecting schema mismatches outright. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b4bdbd7 commit e342f5c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "vgi-rpc"
3-
version = "0.1.13"
3+
version = "0.1.14"
44
description = "Vector Gateway Interface - RPC framework based on Apache Arrow"
55
readme = "README.md"
66
requires-python = ">=3.13"

vgi_rpc/rpc/_server.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,12 @@ def _serve_stream(
580580
input_batch, resolved_cm, release_fn = resolve_shm_batch(input_batch, resolved_cm, shm)
581581

582582
if input_batch.schema != input_schema:
583-
raise TypeError(f"Input schema mismatch: expected {input_schema}, got {input_batch.schema}")
583+
# Cast compatible types (e.g., decimal→double, int32→int64)
584+
try:
585+
input_batch = input_batch.cast(input_schema)
586+
except (pa.ArrowInvalid, pa.ArrowNotImplementedError, ValueError):
587+
msg = f"Input schema mismatch: expected {input_schema}, got {input_batch.schema}"
588+
raise TypeError(msg) from None
584589

585590
ab_in = AnnotatedBatch(batch=input_batch, custom_metadata=resolved_cm, _release_fn=release_fn)
586591
if prev_input is not None:

0 commit comments

Comments
 (0)