Condition in IterableQuery does not work in inverse order of operands for some operators
This example works:
s_num = (numbers: 1, 2, 3, 4)
s1 = s_num where numbers != 2
but this does not:
s_num = (numbers: 1, 2, 3, 4)
s1 = s_num where 2 != numbers
Error:
Traceback (most recent call last):
File "../scripts/run_locally.py", line 30, in <module>
print(f'var: {var.name}, type: {var.type_}, value: {var.value}')
File "/home/ubuntu/vre-language/interpreter/workflow_executor.py", line 623, in func_value
func, pars = self.func
File "/home/ubuntu/vre-language/interpreter/workflow_executor.py", line 138, in variable_func
self.__func = checkref(self.parameter)
File "/home/ubuntu/vre-language/interpreter/workflow_executor.py", line 110, in checkref
ret = obj.func
File "/home/ubuntu/vre-language/interpreter/workflow_executor.py", line 231, in object_query_func
condition = self.condition.value # fixme deferred
File "/home/ubuntu/vre-language/interpreter/workflow_executor.py", line 624, in func_value
self.__value = func(*[p.value for p in pars])
File "/home/ubuntu/python3-venv/lib/python3.8/site-packages/pint/quantity.py", line 140, in wrapped
return f(self, *args, **kwargs)
File "/home/ubuntu/python3-venv/lib/python3.8/site-packages/pint/quantity.py", line 1651, in __ne__
out = self.__eq__(other)
File "/home/ubuntu/python3-venv/lib/python3.8/site-packages/pint/quantity.py", line 140, in wrapped
return f(self, *args, **kwargs)
File "/home/ubuntu/python3-venv/lib/python3.8/site-packages/pint/quantity.py", line 1610, in __eq__
if zero_or_nan(other, True):
File "/home/ubuntu/python3-venv/lib/python3.8/site-packages/pandas/core/generic.py", line 1527, in __nonzero__
raise ValueError(
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Note that the error occurs only when the column name is right operand and only with operators !=
and ==
. With <
, >
, <=
and >=
it works.