You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Improve Filtering Function and Add Support for Additional Operators
Description:
The filtering function in our application can be refactored for better understandability and extensibility. Currently, the logic is a bit hard to follow. By pulling out the filtering into a dedicated function, we could make the code easier to understand and maintain. In addition, we should add support for more operators to increase the versatility of our filtering.
Tasks:
Refactor the current filtering code into a separate function, possibly with this signature: if all(matches(device, key) for key in criteria):
Add support for the following operators:
==, != for literal matches (strings, numeric types, bools)
>=, <=, >, < for comparison (strings (alphabetic), numeric)
=~ for regex matches (strings, numeric), borrowing the operator from bash
Handle malformed regex that would be valid literal text i.e., text with an unpaired parenthesis.
Replace re.match with re.search for more comprehensive string pattern searching.
Test the new filtering function with various scenarios and edge cases.
Update related documentation to reflect the new filtering functionality and supported operators.
Acceptance Criteria:
The filtering function is refactored into a separate, more understandable function.
The application successfully supports the additional operators.
The application correctly handles malformed regex.
The re.match function is replaced with re.search for more comprehensive string pattern searching.
The new functionality is validated and tested in different scenarios.
The documentation is updated to reflect the enhanced filtering functionality and added operators.
The text was updated successfully, but these errors were encountered:
le91688
changed the title
[IMPROVEMENT] Refactor filtering function
Refactor filtering function
Jun 27, 2023
Title: Improve Filtering Function and Add Support for Additional Operators
Description:
The filtering function in our application can be refactored for better understandability and extensibility. Currently, the logic is a bit hard to follow. By pulling out the filtering into a dedicated function, we could make the code easier to understand and maintain. In addition, we should add support for more operators to increase the versatility of our filtering.
Tasks:
if all(matches(device, key) for key in criteria):
==, !=
for literal matches (strings, numeric types, bools)>=, <=, >, <
for comparison (strings (alphabetic), numeric)=~
for regex matches (strings, numeric), borrowing the operator from bashre.match
withre.search
for more comprehensive string pattern searching.Acceptance Criteria:
re.match
function is replaced withre.search
for more comprehensive string pattern searching.The text was updated successfully, but these errors were encountered: