Repository: mars-project/mars

Issue:
[BUG] `logical_and` execution failed 
<!--
Thank you for your contribution!

Please review https://github.com/mars-project/mars/blob/master/CONTRIBUTING.rst before opening an issue.
-->

**Describe the bug**

`logical_and` execution failed  with error `TypeError: 'NoneType' object is not iterable`.

**To Reproduce**
To help us reproducing this bug, please provide information below:
1. Your Python version
2. The version of Mars you use
3. Versions of crucial packages, such as numpy, scipy and protobuf
4. Full stack of the error.
5. Minimized code to reproduce the error.

```python
import mars.tensor as mt
import mars.dataframe as md

df = md.DataFrame(mt.random.rand(100, 3), columns=['a', 'b', 'c'])
df.drop(columns=['a'], inplace=True)
c = (df['b'] < 1000) & (df['c'] > 1.0)
print(c.execute())
```

```
Traceback (most recent call last):
  File "/Users/qinxuye/Downloads/test_mars3.py", line 13, in <module>
    print(c.execute())
  File "/Users/qinxuye/Workspace/mars/mars/core.py", line 579, in execute
    self._data.execute(session, **kw)
  File "/Users/qinxuye/Workspace/mars/mars/core.py", line 367, in execute
    session.run(self, **kw)
  File "/Users/qinxuye/Workspace/mars/mars/session.py", line 461, in run
    result = self._sess.run(*tileables, **kw)
  File "/Users/qinxuye/Workspace/mars/mars/session.py", line 106, in run
    res = self._executor.execute_tileables(tileables, **kw)
  File "/Users/qinxuye/Workspace/mars/mars/utils.py", line 408, in _wrapped
    return func(*args, **kwargs)
  File "/Users/qinxuye/Workspace/mars/mars/utils.py", line 502, in inner
    return func(*args, **kwargs)
  File "/Users/qinxuye/Workspace/mars/mars/executor.py", line 860, in execute_tileables
    tileables, tileable_graph=tileable_graph)
  File "/Users/qinxuye/Workspace/mars/mars/utils.py", line 408, in _wrapped
    return func(*args, **kwargs)
  File "/Users/qinxuye/Workspace/mars/mars/utils.py", line 502, in inner
    return func(*args, **kwargs)
  File "/Users/qinxuye/Workspace/mars/mars/tiles.py", line 350, in build
    tileables, tileable_graph=tileable_graph)
  File "/Users/qinxuye/Workspace/mars/mars/utils.py", line 408, in _wrapped
    return func(*args, **kwargs)
  File "/Users/qinxuye/Workspace/mars/mars/utils.py", line 502, in inner
    return func(*args, **kwargs)
  File "/Users/qinxuye/Workspace/mars/mars/tiles.py", line 263, in build
    self._on_tile_failure(tileable_data.op, exc_info)
  File "/Users/qinxuye/Workspace/mars/mars/tiles.py", line 302, in inner
    raise exc_info[1].with_traceback(exc_info[2]) from None
  File "/Users/qinxuye/Workspace/mars/mars/tiles.py", line 243, in build
    tiled = self._tile(tileable_data, tileable_graph)
  File "/Users/qinxuye/Workspace/mars/mars/tiles.py", line 338, in _tile
    return super()._tile(tileable_data, tileable_graph)
  File "/Users/qinxuye/Workspace/mars/mars/tiles.py", line 201, in _tile
    tds[0]._inplace_tile()
  File "/Users/qinxuye/Workspace/mars/mars/core.py", line 163, in _inplace_tile
    return handler.inplace_tile(self)
  File "/Users/qinxuye/Workspace/mars/mars/tiles.py", line 136, in inplace_tile
    dispatched = self.dispatch(to_tile.op)
  File "/Users/qinxuye/Workspace/mars/mars/utils.py", line 408, in _wrapped
    return func(*args, **kwargs)
  File "/Users/qinxuye/Workspace/mars/mars/tiles.py", line 119, in dispatch
    tiled = op_cls.tile(op)
  File "/Users/qinxuye/Workspace/mars/mars/dataframe/arithmetic/core.py", line 255, in tile
    return cls._tile_both_series(op)
  File "/Users/qinxuye/Workspace/mars/mars/dataframe/arithmetic/core.py", line 106, in _tile_both_series
    nsplits, out_shape, left_chunks, right_chunks = align_series_series(left, right)
  File "/Users/qinxuye/Workspace/mars/mars/dataframe/align.py", line 731, in align_series_series
    left_index_chunks, right_index_chunks)
  File "/Users/qinxuye/Workspace/mars/mars/dataframe/align.py", line 490, in _calc_axis_splits
    right_splits = left_splits = [[c] for c in left_chunk_index_min_max]
TypeError: 'NoneType' object is not iterable
```



Discussion:

Resolving patch:
diff --git a/mars/dataframe/base/drop.py b/mars/dataframe/base/drop.py
--- a/mars/dataframe/base/drop.py
+++ b/mars/dataframe/base/drop.py
@@ -117,7 +117,7 @@ def tile(cls, op: 'DataFrameDrop'):
                     col_to_args[c.index[1]] = (new_dtypes, new_col_id)
 
                 params.update(dict(dtypes=new_dtypes, index=(c.index[0], new_col_id),
-                                   index_value=parse_index(None, (c.key, c.index_value.key))))
+                                   index_value=c.index_value))
                 if op.index is not None:
                     params.update(dict(shape=(np.nan, len(new_dtypes)),
                                        index_value=parse_index(None, (c.key, c.index_value.key))))


Test patch:
diff --git a/mars/dataframe/base/tests/test_base.py b/mars/dataframe/base/tests/test_base.py
--- a/mars/dataframe/base/tests/test_base.py
+++ b/mars/dataframe/base/tests/test_base.py
@@ -785,13 +785,25 @@ def testDrop(self):
         raw = pd.DataFrame(rs.randint(1000, size=(20, 8)),
                            columns=['c' + str(i + 1) for i in range(8)])
 
-        df = from_pandas_df(raw, chunk_size=3)
+        df = from_pandas_df(raw, chunk_size=8)
 
         with self.assertRaises(KeyError):
             df.drop(columns=['c9'])
         with self.assertRaises(NotImplementedError):
             df.drop(columns=from_pandas_series(pd.Series(['c9'])))
 
+        r = df.drop(columns=['c1'])
+        pd.testing.assert_index_equal(r.index_value.to_pandas(), raw.index)
+
+        tiled = r.tiles()
+        start = 0
+        for c in tiled.chunks:
+            raw_index = raw.index[start: start + c.shape[0]]
+            start += c.shape[0]
+            pd.testing.assert_index_equal(raw_index, c.index_value.to_pandas())
+
+        df = from_pandas_df(raw, chunk_size=3)
+
         columns = ['c2', 'c4', 'c5', 'c6']
         index = [3, 6, 7]
         r = df.drop(columns=columns, index=index)