Skip to content

Propagate lazy query errors through jq JSON conversion - #107

Merged
apstndb merged 1 commit into
mainfrom
fix/review-lazy-json-errors
Sep 22, 2026
Merged

apstndb merged 1 commit into
mainfrom
fix/review-lazy-json-errors

Conversation

@apstndb

@apstndb apstndb commented Sep 22, 2026

Copy link
Copy Markdown
Owner

When a lazy query fails while tojson, @json, or format("json") materializes rows, the embedded jq encoder previously panicked instead of returning the Spanner error.

Add small jq definitions that normalize lazy values before JSON encoding and return the original error through jq's normal error path, including try/catch. Keep gojq's JSON number/string formatting, other format operations, and user-defined function overrides. No dependency fork, replacement, or panic recovery is introduced.

Validation: Go 1.25.13 build, full emulator-backed tests, and lint; CLI regressions for original error codes/messages and catch behavior; 100 independent differential checks against the unchanged jq engine for healthy values and format/function combinations. The four independent fixes were also validated together.

@apstndb
apstndb merged commit 0e1a765 into main Sep 22, 2026
2 checks passed
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.

1 participant