# Buggy code
def execute_graph(
    self,
    graph,
    keys,
    n_parallel=None,
    print_progress=False,
    mock=False,
    no_intermediate=False,
    compose=True,
    retval=True,
    chunk_result=None,
):
    """
    :param graph: graph to execute
    :param keys: result keys
    :param n_parallel: num of max parallelism
    :param print_progress:
    :param compose: if True. fuse nodes when possible
    :param mock: if True, only estimate data sizes without execution
    :param no_intermediate: exclude intermediate data sizes when estimating memory size
    :param retval: if True, keys specified in argument keys is returned
    :param chunk_result: dict to put chunk key to chunk data, if None, use self.chunk_result
    :return: execution result
    """
    optimized_graph = self._preprocess(graph, keys) if compose else graph

    if not mock:
        # fetch_keys only useful when calculating sizes
        fetch_keys = set()
    else:
        fetch_keys = set(v.key for v in graph if isinstance(v.op, Fetch))
        for c in graph:
            if graph.count_predecessors(c) != 0:
                continue
            fetch_keys.update(inp.key for inp in c.inputs or ())

    executed_keys = list(
        itertools.chain(*[v[1] for v in self.stored_tileables.values()])
    )
    chunk_result = self._chunk_result if chunk_result is None else chunk_result
    graph_execution = GraphExecution(
        chunk_result,
        optimized_graph,
        keys,
        executed_keys,
        self._sync_provider,
        n_parallel=n_parallel,
        engine=self._engine,
        prefetch=self._prefetch,
        print_progress=print_progress,
        mock=mock,
        mock_max_memory=self._mock_max_memory,
        fetch_keys=fetch_keys,
        no_intermediate=no_intermediate,
    )
    res = graph_execution.execute(retval)
    self._mock_max_memory = max(self._mock_max_memory, graph_execution._mock_max_memory)
    if mock:
        self._chunk_result.clear()
    return res


# Traceback (Exception)
In [28]: df = md.DataFrame(np.random.rand(10, 2))

In [29]: df + np.random.rand(10, 2)
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-29-4a212df011a8> in <module>
----> 1 df + np.random.rand(10, 2)

~/Documents/mars_dev/mars/mars/dataframe/utils.py in wrapper(*args, **kwargs)
613     def wrapper(*args, **kwargs):
614         try:
--> 615             return func(*args, **kwargs)
616         except NotImplementedError:
617             return NotImplemented

~/Documents/mars_dev/mars/mars/dataframe/arithmetic/add.py in add(df, other, axis, level, fill_value)
33
34 def add(df, other, axis='columns', level=None, fill_value=None):
---> 35     other = wrap_sequence(other)
36     op = DataFrameAdd(axis=axis, level=level, fill_value=fill_value, lhs=df, rhs=other)
37     return op(df, other)

~/Documents/mars_dev/mars/mars/dataframe/utils.py in wrap_sequence(seq)
606
607     if isinstance(seq, (list, tuple, np.ndarray, TENSOR_TYPE)):
--> 608         seq = Series(seq)
609     return seq
610

~/Documents/mars_dev/mars/mars/dataframe/initializer.py in __init__(self, data, index, dtype, name, copy, chunk_size, gpu, sparse)
46             series = data
47         else:
---> 48             pd_series = pd.Series(data, index=index, dtype=dtype, name=name, copy=copy)
49             series = from_pandas_series(pd_series, chunk_size=chunk_size, gpu=gpu, sparse=sparse)
50         super(Series, self).__init__(series.data)

~/miniconda3/lib/python3.7/site-packages/pandas/core/series.py in __init__(self, data, index, dtype, name, copy, fastpath)
312                     data = data.copy()
313             else:
--> 314                 data = sanitize_array(data, index, dtype, copy, raise_cast_failure=True)
315
316                 data = SingleBlockManager(data, index, fastpath=True)

~/miniconda3/lib/python3.7/site-packages/pandas/core/internals/construction.py in sanitize_array(data, index, dtype, copy, raise_cast_failure)
727     elif subarr.ndim > 1:
728         if isinstance(data, np.ndarray):
--> 729             raise Exception("Data must be 1-dimensional")
730         else:
731             subarr = com.asarray_tuplesafe(data, dtype=dtype)

Exception: Data must be 1-dimensional

# Fixed code
def execute_graph(
    self,
    graph,
    keys,
    n_parallel=None,
    print_progress=False,
    mock=False,
    no_intermediate=False,
    compose=True,
    retval=True,
    chunk_result=None,
):
    """
    :param graph: graph to execute
    :param keys: result keys
    :param n_parallel: num of max parallelism
    :param print_progress:
    :param compose: if True. fuse nodes when possible
    :param mock: if True, only estimate data sizes without execution
    :param no_intermediate: exclude intermediate data sizes when estimating memory size
    :param retval: if True, keys specified in argument keys is returned
    :param chunk_result: dict to put chunk key to chunk data, if None, use self.chunk_result
    :return: execution result
    """
    optimized_graph = self._preprocess(graph, keys) if compose else graph

    if not mock:
        # fetch_keys only useful when calculating sizes
        fetch_keys = set()
    else:
        fetch_keys = set(v.key for v in graph if isinstance(v.op, Fetch))
        for c in graph:
            if graph.count_predecessors(c) != 0:
                continue
            fetch_keys.update(inp.key for inp in c.inputs or ())

    executed_keys = list(
        itertools.chain(*[v[1] for v in self.stored_tileables.values()])
    )
    chunk_result = self._chunk_result if chunk_result is None else chunk_result
    graph_execution = GraphExecution(
        chunk_result,
        optimized_graph,
        keys,
        executed_keys,
        self._sync_provider,
        n_parallel=n_parallel,
        engine=self._engine,
        prefetch=self._prefetch,
        print_progress=print_progress,
        mock=mock,
        mock_max_memory=self._mock_max_memory,
        fetch_keys=fetch_keys,
        no_intermediate=no_intermediate,
    )
    res = graph_execution.execute(retval)
    self._mock_max_memory = max(self._mock_max_memory, graph_execution._mock_max_memory)
    if mock:
        chunk_result.clear()
    return res