Skip to content

"multiple" option on a field along with the "in" operator #2

Description

@daveisagit

I am using the "multiple" option on a field along with the "in" operator.
The rule set is

{
  "condition": "AND",
  "rules": [
    {
      "id": "location",
      "field": "location",
      "type": "string",
      "input": "select",
      "operator": "in",
      "value": [
        "Place A",
        "Place B",
        "Place C"
      ]
    }
  ],
  "valid": true
}

Gives an error which indicates that the "list" of places is not expected, but that would seem to makes to me anyway.
What do you think?

', ' File "/usr/local/lib/python3.8/site-packages/jqqb_evaluator/evaluator.py", line 17, in object_matches_rules
 return RuleGroup(self.parsed_rule_set).evaluate(obj)
', ' File "/usr/local/lib/python3.8/site-packages/jqqb_evaluator/rule_group.py", line 11, in evaluate
 return all(map(lambda x: RuleGroup.get_rule_object(x).evaluate(obj), self.rules))
', ' File "/usr/local/lib/python3.8/site-packages/jqqb_evaluator/rule_group.py", line 11, in <lambda>
 return all(map(lambda x: RuleGroup.get_rule_object(x).evaluate(obj), self.rules))
', ' File "/usr/local/lib/python3.8/site-packages/jqqb_evaluator/rule.py", line 18, in evaluate
 return self.get_operator()(self.get_input(obj), self.get_value())
', ' File "/usr/local/lib/python3.8/site-packages/jqqb_evaluator/operators.py", line 44, in eval_in
 return right in left

Should the code be

return left in right

?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions