8000 feat(annotations): span annotation filters by axiomofjoy · Pull Request #7109 · Arize-ai/phoenix · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(annotations): span annotation filters #7109

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

Merged
merged 11 commits into from
Apr 10, 2025

Conversation

axiomofjoy
Copy link
Contributor

resolves #6921

Copy link
pkg-pr-new bot commented Apr 10, 2025

Open in StackBlitz

npm i https://pkg.pr.new/Arize-ai/phoenix/@arizeai/phoenix-client@7109
npm i https://pkg.pr.new/Arize-ai/phoenix/@arizeai/phoenix-mcp@7109

commit: 80ef469

@axiomofjoy axiomofjoy changed the base branch from main to feat/annotations April 10, 2025 06:06
@axiomofjoy axiomofjoy marked this pull request as ready for review April 10, 2025 06:07
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 10, 2025
Copy link
Contributor
@cephalization cephalization left a comment

Choose a reason for hiding this comment

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

This makes sense to me

@github-project-automation github-project-automation bot moved this from 📘 Todo to 👍 Approved in phoenix Apr 10, 2025
input SpanAnnotationFilterCondition {
name: String
source: AnnotationSource
userIds: [GlobalID!]
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious what the use-case for a list of users would be here. In general I like it, mainly curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you want to filter for annotations from a particular user/ set of users. I think was your idea, it's on the ticket.

Comment on lines 36 to 38
user_rowids = set(
from_global_id_with_expected_type(user_id, "User") for user_id in include.user_ids
)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. this can be cached in a private variable via __post_init__ on the Filter object itself. FWIW, a list would be faster if the set is small.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably true wrt list.

Comment on lines +21 to +22
include: Optional[SpanAnnotationFilterCondition] = UNSET
exclude: Optional[SpanAnnotationFilterCondition] = UNSET
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. maybe raise an exception via __post_init__ if there is a contradiction, e.g. when a name is both included and excluded

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That strikes me as a situation we should just return an empty list.

@axiomofjoy axiomofjoy merged commit 899354d into feat/annotations Apr 10, 2025
55 checks passed
@axiomofjoy axiomofjoy deleted the xander/annotation-filters branch April 10, 2025 22:52
@github-project-automation github-project-automation bot moved this from 👍 Approved to ✅ Done in phoenix Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[annotations] filters on annotations (user_id, name include list, name exclude list, source)
4 participants
0