Skip to content

fix(postgrest): serialize filter values in eq() - #1591

Open
chengwudi1 wants to merge 1 commit into
supabase:mainfrom
chengwudi1:fix/postgrest-eq-value-serialization
Open

fix(postgrest): serialize filter values in eq()#1591
chengwudi1 wants to merge 1 commit into
supabase:mainfrom
chengwudi1:fix/postgrest-eq-value-serialization

Conversation

@chengwudi1

Copy link
Copy Markdown

What

Fixes #1583.eq() stringified filter values directly, so None produced eq.None (invalid SQL) and dict/list
values (for JSON columns) were serialized as Python reprs.

How

Added _serialize_filter_value() in base_request_builder.py and used it in .eq():

  • Nonenull
  • booltrue / false
  • dict / list → compact JSON ({"key":"value"})
  • everything else → unchanged str()

Tests

Added parametrized test_eq_serializes_values in both tests/_async and tests/_sync (7 cases: None, True, False,
dict, list, str, int).

Verified: reverting only the source change fails 5/7 cases. All 192 unit tests pass; ruff check and ruff format
clean.

@chengwudi1
chengwudi1 requested review from a team and o-santi as code owners August 25, 2026 15:30
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.

.eq() needs to properly serialize values

1 participant