Skip to content

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

Merged
o-santi merged 1 commit into
supabase:mainfrom
chengwudi1:fix/postgrest-eq-value-serialization
Oct 1, 2026
Merged

o-santi merged 1 commit into
supabase:mainfrom
chengwudi1:fix/postgrest-eq-value-serialization

Conversation

@chengwudi1

Copy link
Copy Markdown
Contributor

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():

  • None → null
  • bool → true / 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
@chengwudi1

Copy link
Copy Markdown
Contributor Author

Hi @grdsdev! Friendly ping on this one — it's been two weeks with no activity. The PR adds _serialize_filter_value so eq()/filter values serialize correctly (None → null, bool → true/false, dict/list → compact JSON), with 14 parametrized tests, all green. Happy to rebase or adjust if needed — could you take a look when you have a moment? Thanks!

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

2 participants