Skip to content

.not_.or_() silently drops the negation #1616

Description

@twelfthlabor

Chaining .not_ before .or_() drops the negation. .not_.or_("id.eq.1") sends or=(id.eq.1) when it should send not.or=(id.eq.1). You get the opposite rows back with no error.

Checked on current main: .not_.eq() and .not_.in_() correctly produce not.eq / not.in. Only .or_() is wrong. In base_request_builder.py, filter() consumes the negate_next flag, but or_() appends its param directly and never checks it.

Verified against local PostgREST 16.2 that not.or= is valid syntax: or=(id.eq.1) returned row 1, not.or=(id.eq.1) returned everything except row 1.

The not_ docstring says the next filter gets negated, and or_ is a filter. text_search builds params the same direct way so it may have the same problem, but I only verified or_ end to end.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions