Repository: modin-project/modin

Issue:
UserWarning: `Series.__getstate__` defaulting to pandas implementation. 
<!--
General questions should be asked on the mailing list modin-dev@googlegroups.com.

Before submitting an issue, please fill out the following form.
-->

### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:Ubuntu 18.04.1 LTS
- **Modin installed from (source or binary)**:binary
- **Modin version**:0.5.4
- **Python version**:3.6.8
- **Exact command to reproduce**:
The ‘merged’ is a DataFrame that 'modin.pandas.concat(list)' function generates. The column of ‘ticker’ is a series that the type of element  is an integer.
```
merged['ticker'] = merged['ticker'].astype(str)
```

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
<!-- Describe the problem clearly here. -->
Then raise a warning:
```
UserWarning: `Series.__getstate__` defaulting to pandas implementation.
```
The program is stuck and don't go on.
### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->



Discussion:
Thanks @FlamesCN for reporting this.

I narrowed down the issue to how we assign columns. Apparently, we have a bug in assigning a column after it has been modified, so it will be relatively easy to fix. Thanks for the report!

Resolving patch:
diff --git a/modin/backends/pandas/query_compiler.py b/modin/backends/pandas/query_compiler.py
--- a/modin/backends/pandas/query_compiler.py
+++ b/modin/backends/pandas/query_compiler.py
@@ -1149,6 +1149,8 @@ def _setitem():
                 _setitem()
             return df
 
+        if isinstance(value, type(self)):
+            value = value.to_pandas()
         if is_list_like(value):
             new_modin_frame = self._modin_frame._apply_full_axis_select_indices(
                 axis,
diff --git a/modin/pandas/dataframe.py b/modin/pandas/dataframe.py
--- a/modin/pandas/dataframe.py
+++ b/modin/pandas/dataframe.py
@@ -1943,6 +1943,8 @@ def setitem_without_string_columns(df):
             new_self = DataFrame({key: value}, columns=self.columns)
             self._update_inplace(new_self._query_compiler)
         else:
+            if isinstance(value, Series):
+                value = value._query_compiler
             self._update_inplace(self._query_compiler.setitem(0, key, value))
 
     def __hash__(self):


Test patch:
diff --git a/modin/pandas/test/test_dataframe.py b/modin/pandas/test/test_dataframe.py
--- a/modin/pandas/test/test_dataframe.py
+++ b/modin/pandas/test/test_dataframe.py
@@ -4962,6 +4962,13 @@ def test___setitem__(self, data):
 
         df_equals(modin_df, pandas_df)
 
+        # Test series assignment to column
+        modin_df = pd.DataFrame(columns=modin_df.columns)
+        pandas_df = pandas.DataFrame(columns=pandas_df.columns)
+        modin_df[modin_df.columns[-1]] = modin_df[modin_df.columns[0]]
+        pandas_df[pandas_df.columns[-1]] = pandas_df[pandas_df.columns[0]]
+        df_equals(modin_df, pandas_df)
+
         # Transpose test
         modin_df = pd.DataFrame(data).T
         pandas_df = pandas.DataFrame(data).T