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.
This PR introduces using "not equals" expressions, such as !=, over the
not_token
for theconvert_condition_field_eq_val()
method and all theconvert_condition_field_eq_val_*()
methods.This is done by using a context manager inside
convert_condition_field_eq_val()
. Theconvert_condition_field_eq_val()
method will first check if:ConditionNOT
convert_not_as_not_eq
class flag isTrue
The resulting
bool
value is passed to the context manager as theuse_negated_expressions
arg, the the method carries on like normal. Ifuse_negated_expressions
is True, the following expressions will be temporarily swapped with their 'not equals' counterpart while converting the condition using theconvert_condition_field_eq_val_*()
methods, then swapped back after the conversion is complete:I have also added tests for this new logic in the
test_conversion_base
file.To use this functionality, the backend developer should set the
not equals
expressions listed above in their backend, and setconvert_not_as_not_eq = True
.Here is an example of a passing test using the current logic with the not_token:
vs using the new
not_eq
logic: