Skip to content

Keep the PostgreSQL JSON-path operator intact - #920

Draft
jadenfix wants to merge 2 commits into
andialbrecht:masterfrom
jadenfix:fix/json-question-operators
Draft

jadenfix wants to merge 2 commits into
andialbrecht:masterfrom
jadenfix:fix/json-question-operators

Conversation

@jadenfix

@jadenfix jadenfix commented Oct 6, 2026 •

Copy link
Copy Markdown

@? is split into @ and a ? placeholder, so formatting SELECT data@?? with use_space_around_operators=True produces SELECT data @ ??. Recognize the PostgreSQL JSON-path operator as one token, preserving the following parameter: SELECT data @? ?.

Related to the JSON operator documentation linked in #613. This only fixes @?; it does not resolve that whole issue. ?| and ?& remain outside this change because they are ambiguous with a ? parameter followed by a bitwise operator. Added parsing and formatting regressions plus controls for parameters followed by ||, | and &.

Validation: make test passes on Python 3.10–3.14 (512 passed, 2 expected failures and 1 existing unexpected pass per version); lint, coverage (97%), and package build pass. The full native test matrix also passes on the exact PR commit: Python 3.10–3.14 on Linux and Python 3.11 on macOS and Windows. Confirmed @? tokenization and formatting fail on the base commit and pass with this change, while parameter/operator controls retain their original behavior.

  • ran the tests (pytest)
  • all style issues addressed (ruff)
  • changes are covered by tests
  • documentation reviewed; no public API change

Required upstream checks still await maintainer approval.

Prepared with OpenAI Codex assistance.

Signed-off-by: Jaden Fix <jadenfix20@gmail.com>
@jadenfix

jadenfix commented Oct 6, 2026 •

Copy link
Copy Markdown
Author

@andialbrecht, could you approve the pending fork CI and take a look when convenient? This now only fixes the PostgreSQL JSON-path operator @?. On review I narrowed the change to preserve ? parameters followed by concatenation or bitwise operators; regression tests cover those controls. The full local Python 3.10–3.14 test matrix passes (512 passed per version). Thanks!

Signed-off-by: Jaden Fix <jadenfix20@gmail.com>
@jadenfix jadenfix changed the title Keep PostgreSQL JSON question-mark operators intact Keep the PostgreSQL JSON-path operator intact Oct 6, 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.

1 participant