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

feat: Supports filter string using regular expression matching #3055

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chai3
Copy link

@chai3 chai3 commented Aug 23, 2024

What does this PR do?

closes #XXX(not yet issues)
https://github.com/orgs/langfuse/discussions/3014

  • I implemented only that regular expression matching is true and case-insensitively.

image

Type of change

  • New feature (non-breaking change which adds functionality)

Copy link

vercel bot commented Aug 23, 2024

@chai3 is attempting to deploy a commit to the langfuse Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Disclaimer: Experimental PR review

PR Summary

This PR adds support for regular expression matching in filters, enhancing string matching capabilities in the Langfuse system.

  • Added 'regex with' operator in packages/shared/src/filterToPrisma.ts, mapping to PostgreSQL's case-insensitive regex operator '~*'
  • Updated packages/shared/src/interfaces/filters.ts to include 'regex with' operator for 'string' and 'stringObject' filter types
  • Implementation follows existing patterns for filter operations, but requires careful consideration of security and performance implications
  • No changes made to existing regex validation functions, which should be utilized to ensure safe regex usage

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@chai3
Copy link
Author

chai3 commented Aug 23, 2024

invalid regex got

image

can this be allowed?

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.

1 participant