Skip to content

Commit 9016837

Browse files
rustyconoverclaude
andcommitted
arguments refs: refusal messages name their kind; CI wheel jobs install the pinned vgi-rpc
invalid_arguments_ref and arguments_ref_integrity keep their kind and code, and their message now starts with the kind. The DuckDB extension shows a worker error as "<type>: <message>", so without it the reason a caller acts on never appears (the extension's arguments_ref_errors.test looks for invalid_arguments_ref). arguments_ref_missing keeps the spec's exact message. ci: a built wheel resolves vgi-rpc from PyPI (uv sources are not part of it), where 0.56 has no StateRef, so the wheel and bare-install jobs failed to import vgi. They now install the pinned commit alongside (VGI_RPC_PIN, the same commit as pyproject; TODO(release-wave)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 663b940 commit 9016837

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ on:
1616
permissions:
1717
contents: read
1818

19+
env:
20+
# TODO(release-wave): protocol 3.4 needs unreleased vgi-rpc (StateRef, object
21+
# store, argument-reference grants). Same commit as the pyproject pin. A built
22+
# wheel resolves vgi-rpc from PyPI (uv sources are not part of it), so the
23+
# wheel jobs install this commit alongside; drop it with the pin.
24+
VGI_RPC_PIN: "vgi-rpc @ git+https://github.com/Query-farm/vgi-rpc-python@3a069830eb296ab452bd83f87a243ca71f7f7a3e"
25+
1926
jobs:
2027
test:
2128
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
@@ -68,7 +75,7 @@ jobs:
6875
- name: Install the wheel with only [${{ matrix.extra }}]
6976
run: |
7077
uv venv --python 3.13 "$RUNNER_TEMP/venv"
71-
VIRTUAL_ENV="$RUNNER_TEMP/venv" uv pip install "$(ls dist/vgi_python-*.whl)[${{ matrix.extra }}]"
78+
VIRTUAL_ENV="$RUNNER_TEMP/venv" uv pip install "$(ls dist/vgi_python-*.whl)[${{ matrix.extra }}]" "$VGI_RPC_PIN"
7279
7380
- name: Evaluate pushed-down filters (plain and intersects_extent)
7481
working-directory: ${{ runner.temp }}
@@ -238,7 +245,7 @@ jobs:
238245

239246
- name: Import attach-path modules from the bare wheel
240247
run: |
241-
uv run --isolated --no-project --python 3.14 --with dist/*.whl \
248+
uv run --isolated --no-project --python 3.14 --with dist/*.whl --with "$VGI_RPC_PIN" \
242249
python -c "import vgi, vgi.worker, vgi.query_execution; print('ok')"
243250
244251
s3-offload-localstack:

‎vgi/arguments_ref.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ def install_arguments_ref_header(
169169

170170

171171
def _invalid(message: str) -> StatusError:
172-
return StatusError(message, code=Code.INVALID_ARGUMENT, kind=_INVALID_ARGUMENTS_REF_KIND)
172+
return StatusError(
173+
f"{_INVALID_ARGUMENTS_REF_KIND}: {message}", code=Code.INVALID_ARGUMENT, kind=_INVALID_ARGUMENTS_REF_KIND
174+
)
173175

174176

175177
def resolve_bind_call(bind_call: BindRequest, ctx: CallContext | None) -> BindRequest:
@@ -207,12 +209,17 @@ def resolve_bind_call(bind_call: BindRequest, ctx: CallContext | None) -> BindRe
207209
assert location is not None # BindRequest.__post_init__: exactly one is set
208210
if ctx is None:
209211
raise _invalid("argument references need the request's context to resolve")
210-
from vgi_rpc.state_ref import ArgumentsRefMissingError
212+
from vgi_rpc.state_ref import ArgumentsRefIntegrityError, ArgumentsRefMissingError, InvalidArgumentsRefError
211213

212214
try:
213215
data = ctx.resolve_argument_ref(location.ref, size=location.size, sha256=location.sha256)
214216
except ArgumentsRefMissingError:
215217
raise StatusError(ARGUMENTS_REF_MISSING_MESSAGE, code=Code.NOT_FOUND, kind=ARGUMENTS_REF_MISSING_KIND) from None
218+
except (InvalidArgumentsRefError, ArgumentsRefIntegrityError) as exc:
219+
# Same kind and code; the message also names the kind, because a client
220+
# that shows only "<type>: <message>" (the DuckDB extension) would
221+
# otherwise never show the reason a caller can act on.
222+
raise StatusError(f"{exc.error_kind}: {exc}", code=exc.error_code, kind=exc.error_kind) from None
216223
try:
217224
arguments = Arguments.deserialize_from_bytes(data)
218225
except Exception as exc:

‎vgi/protocol.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ class CopyToContext(ArrowSerializableDataclass):
204204

205205

206206
def _invalid_arguments_ref(message: str) -> StatusError:
207-
return StatusError(message, code=Code.INVALID_ARGUMENT, kind=INVALID_ARGUMENTS_REF_KIND)
207+
# The message names the kind too: some clients show only "<type>: <message>".
208+
return StatusError(
209+
f"{INVALID_ARGUMENTS_REF_KIND}: {message}", code=Code.INVALID_ARGUMENT, kind=INVALID_ARGUMENTS_REF_KIND
210+
)
208211

209212

210213
@dataclass(frozen=True, slots=True, kw_only=True)

0 commit comments

Comments
 (0)