Skip to content

Fix chained JSON operations - #3557

Merged
AzisK merged 2 commits into
kayak:masterfrom
wozhenbang2004:fix-json-chaining-806
Nov 12, 2026
Merged

AzisK merged 2 commits into
kayak:masterfrom
wozhenbang2004:fix-json-chaining-806

Conversation

@wozhenbang2004

Copy link
Copy Markdown
Contributor

Fixes #806.

JSON extraction returned a BasicCriterion, so chaining operations such as .contains() or another .get_json_value() raised AttributeError.

Return a JSON-capable criterion for -> and #>, while keeping text extraction unchanged.

Added six regression tests covering nested containment, key and index access, paths, aliases, and table replacement.

Tests: python -m unittest pypika.tests.dialects.test_postgresql.JSONChainingTests

@wozhenbang2004
wozhenbang2004 requested a review from a team as a code owner November 12, 2026 13:51

@AzisK AzisK 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.

LGTM

@AzisK
AzisK merged commit da6ea2a into kayak:master Nov 12, 2026
19 of 20 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.

Failed to access JSON inner object using JSON functions

2 participants