# Buggy code
def __call__(self, df_or_series):
    inputs = [df_or_series]
    shape = list(df_or_series.shape)
    index_value = df_or_series.index_value
    columns_value = dtypes = None
    if df_or_series.ndim == 2:
        columns_value = df_or_series.columns_value
        dtypes = df_or_series.dtypes

    if self._index is not None:
        shape[0] = self._index.shape[0]
        index_value = asindex(self._index).index_value
        if isinstance(self._index, (Base, Entity)):
            inputs.append(self._index)
    if self._columns is not None:
        shape[1] = self._columns.shape[0]
        dtypes = df_or_series.dtypes.reindex(index=self._columns).fillna(
            np.dtype(np.float64)
        )
        columns_value = parse_index(dtypes.index, store_data=True)
    if self._fill_value is not None and isinstance(self._fill_value, (Base, Entity)):
        inputs.append(self._fill_value)

    if df_or_series.ndim == 1:
        return self.new_series(
            inputs,
            shape=shape,
            dtype=df_or_series.dtype,
            index_value=index_value,
            name=df_or_series.name,
        )
    else:
        return self.new_dataframe(
            inputs,
            shape=shape,
            dtypes=dtypes,
            index_value=index_value,
            columns_value=columns_value,
        )


# Traceback (NotImplementedError)
In [52]: df = md.DataFrame(index=[1, 2, 3])

In [53]: df['a'] = md.Series(['a', 'b', 'c'], index=[2, 3, 4])
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-53-f550a59ef82c> in <module>
----> 1 df['a'] = md.Series(['a', 'b', 'c'], index=[2, 3, 4])

~/Workspace/mars/mars/dataframe/indexing/setitem.py in dataframe_setitem(df, col, value)
182 def dataframe_setitem(df, col, value):
183     op = DataFrameSetitem(target=df, indexes=col, value=value)
--> 184     return op(df, value)

~/Workspace/mars/mars/utils.py in _inner(*args, **kwargs)
457         @functools.wraps(func)
458         def _inner(*args, **kwargs):
--> 459             with self:
460                 return func(*args, **kwargs)
461

~/Workspace/mars/mars/dataframe/indexing/setitem.py in __call__(self, target, value)
83
84             if value.index_value.key != target.index_value.key:  # pragma: no cover
---> 85                 raise NotImplementedError('Does not support setting value '
86                                           'with different index for now')
87

NotImplementedError: Does not support setting value with different index for now

# Fixed code
def __call__(self, df_or_series):
    inputs = [df_or_series]
    shape = list(df_or_series.shape)
    index_value = df_or_series.index_value
    columns_value = dtypes = None
    if df_or_series.ndim == 2:
        columns_value = df_or_series.columns_value
        dtypes = df_or_series.dtypes

    if self._index is not None:
        shape[0] = self._index.shape[0]
        index_value = asindex(self._index).index_value
        self._index = astensor(self._index)
        if isinstance(self._index, (Base, Entity)):
            inputs.append(self._index)
    if self._columns is not None:
        shape[1] = self._columns.shape[0]
        dtypes = df_or_series.dtypes.reindex(index=self._columns).fillna(
            np.dtype(np.float64)
        )
        columns_value = parse_index(dtypes.index, store_data=True)
    if self._fill_value is not None and isinstance(self._fill_value, (Base, Entity)):
        inputs.append(self._fill_value)

    if df_or_series.ndim == 1:
        return self.new_series(
            inputs,
            shape=tuple(shape),
            dtype=df_or_series.dtype,
            index_value=index_value,
            name=df_or_series.name,
        )
    else:
        return self.new_dataframe(
            inputs,
            shape=tuple(shape),
            dtypes=dtypes,
            index_value=index_value,
            columns_value=columns_value,
        )