Skip to content

Filtering by enums is incorrect by AIP-160 #203

@zchenyu

Description

@zchenyu

Hey, I'm trying to understand how this library works for filtering by enums.

In AIP-160, it states

Enums expect the enum's string representation (case-sensitive).

However, it appears that filtering.ParseFilter doesn't accept string for comparing enums.Trying to parse a filter string like state="READY" gives an error like:

check call expr: no matching overload found for calling '=' with [message_type:"my_package.State" primitive:STRING]

Instead, it looks like it uses an ident, as per this example here: https://github.com/einride/spanner-aip-go/blob/master/spanfiltering/transpiler.go#L119 which corresponds to a filter expression like state=READY, which is not conforming to AIP-160.

Am I misunderstanding how this library is used? Or is my assessment correct in that the library incorrectly parsing filters containing enums?

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