Skip to content

fix(postgrest): serialize neq/gt/gte/lt/lte filter values like eq - #1723

Merged
o-santi merged 1 commit into
supabase:mainfrom
mayuriphad:fix/postgrest-comparison-filter-values
Oct 9, 2026
Merged

o-santi merged 1 commit into
supabase:mainfrom
mayuriphad:fix/postgrest-comparison-filter-values

Conversation

@mayuriphad

Copy link
Copy Markdown
Contributor

Fixes #1718

neq(), gt(), gte(), lt() and lte() passed the raw value to filter(), so booleans, None and dicts/lists were sent as their Python str(): neq.False, lte.None, gt.{'n': 1}. PostgREST rejects these. #1591 fixed this for .eq() only, with _serialize_filter_value(). The other five comparison operators now use the same helper, so they send false, null and compact JSON. Strings and numbers are unchanged.

Both the sync and async clients use BaseFilterRequestBuilder. The new parametrized test_comparison_filters_serialize_values is added to both the _sync and _async filter builder tests. It covers each operator with None, booleans, a dict, a list, a string and an int. The 50 non-string/int cases fail on main and pass with this change. ruff check and ruff format --check are clean.

@mayuriphad
mayuriphad requested review from a team and o-santi as code owners October 9, 2026 05:23
Copilot AI balanced review requested due to automatic review settings October 9, 2026 05:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@o-santi
o-santi merged commit d0e1f34 into supabase:main Oct 9, 2026
42 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.

neq(), gt(), gte(), lt(), and lte() stringify booleans, None, and JSON

3 participants