Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability for nested field identifiers #11

Open
tchinz opened this issue Apr 2, 2024 · 0 comments
Open

Add ability for nested field identifiers #11

tchinz opened this issue Apr 2, 2024 · 0 comments

Comments

@tchinz
Copy link

tchinz commented Apr 2, 2024

Take these as example protobuf types

type AuditEvent struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields
    ...
	Id             string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor          *Actor                 `protobuf:"bytes,3,opt,name=actor,proto3" json:"actor,omitempty"`
    ...
}

type Actor struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Id           string    `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
}

Currently a filter like this:

	ListAuditEventsRequest{
		PageSize: 100,
		Filter:   `actor.id:"` + actorId + `"`,
	})

with pika implementation:

	qs := pika.Q[audit_events](r.pika)
	opts := pika.ProtoReflect(&fbapi.AuditEvent{})

	events, token, err := qs.GetPage(ctx, request, opts)
	if err != nil {
		return nil, err
	}

results in

                Error:          Received unexpected error:
                                applying filter from page token: unexpected identifier id

Note that the actor id is a nested identifier. id is a field on the Actor type

This issue is for adding thee ability for Pika to support AIP160 filtering for nested identifiers like actor.id

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

No branches or pull requests

1 participant