-
Notifications
You must be signed in to change notification settings - Fork 20
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 filter option #659
Merged
Merged
Add filter option #659
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
After some work on hand-rolled parser, deemed grammar complex enough that it warranted using a parser generator. Since Lark is already a project dependency, opted to write Lark grammar for filters. This commit adds an intial, rough attempt at the grammar.
Create mostly complete grammar for filter parsing. Some issues remain, and some questions still need to be answered. For instance: - Durations cannot currently be specified in terms of months or years, since the variable length of months creates ambiguities. - Current specs (from Frank) interpret durations as the specified time _ago_, which might create ambiguity when combined with < and >. - Meaningful whitespace in the spec, combined with optional whitespace elsewhere in the spec makes parsing trickier. May be better to remove (and use , for AND. - Need to handle invalid tokens.
This commit modifies the parse tree transformer to return an anonymous function that takes in an arbitrary dictionary object and returns a boolean. I don't know how to obtain a list of all possible keys for the input dictionary, so at present, the transformer simply tries to get the value associated with the key (and returns None if the key is not present). Obviously, in the code's present state, this will cause runtime errors. Future commits will address this issue.
At present, the filtering code pulls state information from at least three distinct objects when filtering tests or test series. This commit creates a new object which aggregates relevant attributes from all of these objects into a single StateAggregate object, which presents a unified interface for accessing these attributes. This is intended to isolate state access, which manages the complexity of the filtering code and allows for cleaner filtering logic.
hwikle-lanl
force-pushed
the
add-filter-option
branch
from
July 9, 2024 19:37
faaf7ea
to
4dfd87c
Compare
Paul-Ferrell
approved these changes
Jul 11, 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.
Code review checklist: