Skip to content

feat(query): expose truncation and row-cap metadata - #6

Closed
efegokdemir wants to merge 1 commit into
Basekick-Labs:mainfrom
efegokdemir:efe/query-response-signals
Closed

efegokdemir wants to merge 1 commit into
Basekick-Labs:mainfrom
efegokdemir:efe/query-response-signals

Conversation

@efegokdemir

Copy link
Copy Markdown

What changed

Expose Arc's truncated, truncation_reason, rows_capped and row_cap response fields on QueryResponse, and document how to distinguish failed/truncated results from results limited by policy.

Older servers remain compatible: missing fields default to False or None.

Testing

  • uv run pytest tests/unit -q --tb=short (103 passed)
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run mypy src/arc_client --ignore-missing-imports

The regression test failed before adding the model fields and passes with this change.

Related: Basekick-Labs/arc#726

@jallegri jallegri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against Arc#726: the model exposes both signals with backward-compatible defaults, preserves the distinction between failed/truncated results and valid policy-capped results, and QueryClient.query() validates the decoded response through this model. I found no code-blocking issues. The PR description reports 103 passing unit tests plus Ruff and mypy. The current GitHub CI run is action_required with no jobs, so the CI result is still outstanding before merge; this review does not treat the author-reported local checks as CI evidence.

Copy link
Copy Markdown
Contributor

Residual transport work tracked in #9; overall parity analysis: https://github.com/Basekick-Labs/ops/issues/40.

This PR covers JSON/model fields. PR #2's MessagePack decoder reconstructs QueryResponse without rows_capped/row_cap, although both pinned server targets emit them. Combining the model changes alone therefore does not preserve MessagePack cap signals. Please test sync/async public decoding paths and assess Arrow trailer visibility separately. Reuse this PR/#2 where appropriate; #9 tracks the unimplemented residual.

@xe-nvdk

xe-nvdk commented Nov 2, 2026

Copy link
Copy Markdown
Member

Closing as superseded: truncated, truncation_reason, rows_capped and row_cap are on main via #25 (src/arc_client/models/query.py), together with the Arrow completion metadata. Thanks for the groundwork, Efe.

@xe-nvdk xe-nvdk closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants