# Buggy code
def __init__(
    self,
    data=None,
    index=None,
    columns=None,
    dtype=None,
    copy=False,
    chunk_size=None,
    gpu=None,
    sparse=None,
):
    if isinstance(data, TENSOR_TYPE):
        if chunk_size is not None:
            data = data.rechunk(chunk_size)
        df = dataframe_from_tensor(
            data, index=index, columns=columns, gpu=gpu, sparse=sparse
        )
    elif isinstance(data, DATAFRAME_TYPE):
        if not hasattr(data, "data"):
            # DataFrameData
            df = _Frame(data)
        else:
            df = data
    elif isinstance(data, dict) and any(
        isinstance(v, (Base, Entity)) for v in data.values()
    ):
        # data is a dict and some value is tensor
        columns = list(data.keys()) if columns is None else columns
        tensors = []
        for c in columns:
            tensors.append(astensor(data[c]))
        df = dataframe_from_1d_tensors(
            tensors, index=index, columns=columns, gpu=gpu, sparse=sparse
        )
    else:
        pdf = pd.DataFrame(data, index=index, columns=columns, dtype=dtype, copy=copy)
        df = from_pandas_df(pdf, chunk_size=chunk_size, gpu=gpu, sparse=sparse)
    super().__init__(df.data)


# Traceback (ValueError)
In [7]: md.DataFrame({'a': '1', 'b': md.Series([1, 2, 3])}).execute()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-7-ec6db392e00f> in <module>
----> 1 md.DataFrame({'a': '1', 'b': md.Series([1, 2, 3])}).execute()

~/Workspace/mars/mars/dataframe/initializer.py in __init__(self, data, index, columns, dtype, copy, chunk_size, gpu, sparse)
46             df = dataframe_from_1d_tensors(
47                 tensors, index=index, columns=columns,
---> 48                 gpu=gpu, sparse=sparse)
49         else:
50             pdf = pd.DataFrame(data, index=index, columns=columns, dtype=dtype, copy=copy)

~/Workspace/mars/mars/dataframe/datasource/from_tensor.py in dataframe_from_1d_tensors(tensors, index, columns, gpu, sparse)
328     op = DataFrameFromTensor(dtypes=dtypes, from_1d_tensors=True,
329                              gpu=gpu, sparse=sparse)
--> 330     return op(tensors, index, columns)
331
332

~/Workspace/mars/mars/dataframe/datasource/from_tensor.py in __call__(self, input_tensor, index, columns)
73     def __call__(self, input_tensor, index, columns):
74         if self._from_1d_tensors:
---> 75             return self._call_input_1d_tensors(input_tensor, index, columns)
76         else:
77             return self._call_input_tensor(input_tensor, index, columns)

~/Workspace/mars/mars/dataframe/datasource/from_tensor.py in _call_input_1d_tensors(self, input_1d_tensors, index, columns)
99     def _call_input_1d_tensors(self, input_1d_tensors, index, columns):
100         if len({t.shape for t in input_1d_tensors}) != 1:
--> 101             raise ValueError('input 1-d tensors should have same shape')
102
103         inputs = list(input_1d_tensors)

ValueError: input 1-d tensors should have same shape

# Fixed code
def __init__(
    self,
    data=None,
    index=None,
    columns=None,
    dtype=None,
    copy=False,
    chunk_size=None,
    gpu=None,
    sparse=None,
):
    if isinstance(data, TENSOR_TYPE):
        if chunk_size is not None:
            data = data.rechunk(chunk_size)
        df = dataframe_from_tensor(
            data, index=index, columns=columns, gpu=gpu, sparse=sparse
        )
    elif isinstance(data, DATAFRAME_TYPE):
        if not hasattr(data, "data"):
            # DataFrameData
            df = _Frame(data)
        else:
            df = data
    elif isinstance(data, dict) and any(
        isinstance(v, (Base, Entity)) for v in data.values()
    ):
        # data is a dict and some value is tensor
        df = dataframe_from_1d_tileables(
            data, index=index, columns=columns, gpu=gpu, sparse=sparse
        )
    else:
        pdf = pd.DataFrame(data, index=index, columns=columns, dtype=dtype, copy=copy)
        df = from_pandas_df(pdf, chunk_size=chunk_size, gpu=gpu, sparse=sparse)
    super().__init__(df.data)