Repository: mars-project/mars

Issue:
[BUG] Failed to execute query when there are multiple arguments
**Describe the bug**
When executing query with more than three joint arguments, the query failed with SyntaxError.

**To Reproduce**
```python
import numpy as np
import mars.dataframe as md
df = md.DataFrame({'a': np.random.rand(100),
                   'b': np.random.rand(100),
                   'c c': np.random.rand(100)})
df.query('a < 0.5 and a != 0.1 and b != 0.2').execute()
```

```
Traceback (most recent call last):
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 131, in visit
    visitor = getattr(self, method)
AttributeError: 'CollectionVisitor' object has no attribute 'visit_Series'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/wenjun.swj/miniconda3/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3417, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-f0b7eeac5829>", line 1, in <module>
    df.query('a < 0.5 and a != 0.1 and b != 0.2').execute()
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 773, in df_query
    predicate = mars_eval(expr, resolvers=(df,), level=level + 1, **kwargs)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 507, in mars_eval
    result = visitor.eval(expr)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 112, in eval
    return self.visit(node)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 134, in visit
    return visitor(node)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 141, in visit_Module
    result = self.visit(expr)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 134, in visit
    return visitor(node)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 145, in visit_Expr
    return self.visit(node.value)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 134, in visit
    return visitor(node)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 178, in visit_BoolOp
    return reduce(func, node.values)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 177, in func
    return self.visit(binop)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 134, in visit
    return visitor(node)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 148, in visit_BinOp
    left = self.visit(node.left)
  File "/Users/wenjun.swj/Code/mars/mars/dataframe/base/eval.py", line 133, in visit
    raise SyntaxError('Query string contains unsupported syntax: {}'.format(node_name))
SyntaxError: Query string contains unsupported syntax: Series
```


Discussion:
Related code is https://github.com/mars-project/mars/blob/25d742793d7c1f5bde5190adbc8f0b7c833e59d3/mars/dataframe/base/eval.py#L126-L127 

Could accept other type like SERIES_TYPE. 

Resolving patch:
diff --git a/mars/dataframe/base/eval.py b/mars/dataframe/base/eval.py
--- a/mars/dataframe/base/eval.py
+++ b/mars/dataframe/base/eval.py
@@ -30,7 +30,6 @@
 from ... import opcodes
 from ...core import ENTITY_TYPE, OutputType, get_output_types, recursive_tile
 from ...serialization.serializables import BoolField, DictField, StringField
-from ..core import DATAFRAME_TYPE
 from ..operands import DataFrameOperand, DataFrameOperandMixin
 from ..utils import parse_index
 
@@ -123,7 +122,7 @@ def get_named_object(self, obj_name):
         raise KeyError(f'name {obj_name} is not defined')
 
     def visit(self, node):
-        if isinstance(node, DATAFRAME_TYPE):
+        if isinstance(node, ENTITY_TYPE):
             return node
         node_name = node.__class__.__name__
         method = 'visit_' + node_name


Test patch:
diff --git a/mars/dataframe/base/tests/test_base_execution.py b/mars/dataframe/base/tests/test_base_execution.py
--- a/mars/dataframe/base/tests/test_base_execution.py
+++ b/mars/dataframe/base/tests/test_base_execution.py
@@ -1876,6 +1876,18 @@ def test_eval_query_execution(setup):
         r.execute(extra_config={'check_index_value': False}).fetch(),
         raw.query(expr))
 
+    expr = 'a < 0.5 and a != 0.1 and b != 0.2'
+    r = df.query(expr)
+    pd.testing.assert_frame_equal(
+        r.execute(extra_config={'check_index_value': False}).fetch(),
+        raw.query(expr))
+
+    expr = '(a < 0.5 or a > 0.7) and (b != 0.1 or `c c` > 0.2)'
+    r = df.query(expr)
+    pd.testing.assert_frame_equal(
+        r.execute(extra_config={'check_index_value': False}).fetch(),
+        raw.query(expr))
+
     copied_df = df.copy()
     copied_df.query('a < b', inplace=True)
     pd.testing.assert_frame_equal(