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
docs: Update the docstring for ExactValueFilter #620
Conversation
It derives from ValueRegexFilter, so it still expects a regular expression. The name itself was a misnomer, it was mostly to handle int values rather than exact values. For filtering on matching str/byte values, we can use the ValueRangeFilter.
When passing non-integer ``value``, it must be valid RE2 patterns. See Google's | ||
`RE2 reference`_ for the accepted syntax. | ||
|
||
.. _RE2 reference: https://github.com/google/re2/wiki/Syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong. I think the value needs to be properly escaped. ie if I pass the number 46 (ascii for .), it will match every single byte value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spoke offline, the current behavior is very surprising and not very useful. In case users using the current behavior, we can't change it.
Instead I propose that we add a new LiteralValueFilter
that
- for ints converts them into bytestrings using the current logic
- for strs converts them to bytestrings
- accepts bytestrings as is
- once everything is normalized to a bytestring, iterate over the bytes and properly escape the bytes to encure they don't get interpreted as control characters. Example: https://github.com/googleapis/java-bigtable/blob/main/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RegexUtil.java#L53-L81
- Deprecate ExactValueFilter and encourage people to migrate to the new filter
- Next major version drop ExactValueFilter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a LiteralValueFilter implementation PR for the v3 branch: #767 (review)
Closing in favor of #767 |
It derives from ValueRegexFilter, so it still expects a regular expression.
The name itself was a misnomer, it was mostly to handle int values rather than exact values.
For filtering on matching str/byte values, we can use the ValueRangeFilter.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #567 🦕