Skip to content

fix(postgrest): preserve negation for or filters - #1619

Open
zfaustk wants to merge 1 commit into
supabase:mainfrom
zfaustk:fix-1616-not-or
Open

zfaustk wants to merge 1 commit into
supabase:mainfrom
zfaustk:fix-1616-not-or

Conversation

@zfaustk

@zfaustk zfaustk commented Sep 6, 2026

Copy link
Copy Markdown

Summary

not_.or_() currently drops the one-shot negation flag and sends or=(...). This makes the client execute the opposite filter from the requested query. The fix consumes the flag in the shared filter builder and emits not.or=(...), including the reference-table form.

Related issue

Closes #1616

Verification

  • uv run --package postgrest pytest -q src/postgrest/tests/_sync/test_filter_request_builder.py src/postgrest/tests/_async/test_filter_request_builder.py src/postgrest/tests/_sync/test_request_builder.py src/postgrest/tests/_async/test_request_builder.py — 176 passed.
  • uv run --package postgrest ruff check src/postgrest/src/postgrest/base_request_builder.py src/postgrest/tests/_sync/test_filter_request_builder.py src/postgrest/tests/_async/test_filter_request_builder.py — pass.
  • git diff --check — pass.

The focused tests cover ordinary or_(), parent not.or, reference-table cities.not.or, and consumption of the one-shot flag in both sync and async builders.

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.

.not_.or_() silently drops the negation

2 participants