-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(general): Update range includes to handle range values #6867
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tsmithv11
requested a deployment
to
scan-security
November 22, 2024 18:23
— with
GitHub Actions
Waiting
tsmithv11
requested a deployment
to
scan-security
November 22, 2024 18:24
— with
GitHub Actions
Waiting
tsmithv11
requested a deployment
to
scan-security
November 22, 2024 19:21
— with
GitHub Actions
Waiting
tsmithv11
requested a deployment
to
scan-security
November 22, 2024 19:51
— with
GitHub Actions
Waiting
mikeurbanski1
approved these changes
Nov 22, 2024
bo156
requested changes
Nov 27, 2024
value = value if isinstance(value, list) else [value] | ||
|
||
# Process each item in the value list | ||
processed_value: List[Any] = [] |
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.
few things here:
- Running code inside constructors is not ideal, is there any reason not to put this block of code inside
get_operation
? - Please extract this part to a new function like
_handle_range_values
for readability of the code - Update the relevant
Readme
to mention we support ranges
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.
1-2 - good callout. Moved.
3 - updated the docs for operators
tsmithv11
requested a deployment
to
scan-security
November 27, 2024 13:52
— with
GitHub Actions
Waiting
tsmithv11
temporarily deployed
to
scan-security
November 27, 2024 13:54
— with
GitHub Actions
Inactive
bo156
approved these changes
Nov 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
range_includes can handle ranges in the value like [4,10-20]
Checklist:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Enhance the
RangeIncludesAttributeSolver
class to support range values in thevalue
parameter, allowing for more flexible attribute checks. This update processes range strings (e.g., "10-20") by converting them into a list of integers, thus enabling the solver to handle both single values and ranges effectively. Additionally, new test cases have been added to validate this functionality, ensuring that bothrange_includes
andrange_not_includes
operations work correctly with the updated logic.RangeIncludesAttributeSolver
, ensuring bothrange_includes
andrange_not_includes
operations work correctly.Modified files (6)
Latest Contributors(2)
RangeIncludesAttributeSolver
to support range values in thevalue
parameter, allowing for more flexible attribute checks.Modified files (1)
Latest Contributors(2)