Repository: modin-project/modin

Issue:
The console output of `pandas.Series` and `modin.Series` is different in the parameters
<!--
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.2 LTS
- **Modin version**: 0.7.3
- **Python version**: 3.8.2
- **Exact command to reproduce**:
```
import pandas
import modin.pandas as pd

index = pandas.date_range("1/1/2000", periods=13, freq="T")

pandas_series = pandas.Series(range(13), index=index)
modin_series = pd.Series(range(13), index=index)

print('Pandas out:\n', pandas_series)
print('\nModin out:\n', modin_series)
```

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
The console output of `pandas.Series` and `modin.Series` is different in the parameters.

### 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. -->
```
Pandas out:
 2000-01-01 00:00:00     0
2000-01-01 00:01:00     1
2000-01-01 00:02:00     2
2000-01-01 00:03:00     3
2000-01-01 00:04:00     4
2000-01-01 00:05:00     5
2000-01-01 00:06:00     6
2000-01-01 00:07:00     7
2000-01-01 00:08:00     8
2000-01-01 00:09:00     9
2000-01-01 00:10:00    10
2000-01-01 00:11:00    11
2000-01-01 00:12:00    12
Freq: T, dtype: int64

Modin out:
 2000-01-01 00:00:00     0
2000-01-01 00:01:00     1
2000-01-01 00:02:00     2
2000-01-01 00:03:00     3
2000-01-01 00:04:00     4
2000-01-01 00:05:00     5
2000-01-01 00:06:00     6
2000-01-01 00:07:00     7
2000-01-01 00:08:00     8
2000-01-01 00:09:00     9
2000-01-01 00:10:00    10
2000-01-01 00:11:00    11
2000-01-01 00:12:00    12
Freq: T, Name: __reduced__, dtype: int64
dtype: int64
```


Discussion:
Also bug with printing pure `modin.pandas.Series` was detected.

Code for reproduce:
```
import numpy as np
import pandas
import modin.pandas as pd

pandas_series = pandas.Series(dtype=np.int64)
modin_series = pd.Series(dtype=np.int64)

print('\nPandas output:\n', pandas_series)
print('\nModin output:\n', modin_series)
```

Output:
```
UserWarning: Distributing <class 'NoneType'> object. This may take some time.

Pandas output:
 Series([], dtype: int64)

Modin output:
 Traceback (most recent call last):
  File "tester.py", line 9, in <module>
    print('\nModin output:\n', modin_series)
  File "/localdisk/aprutsko/modin/modin/pandas/base.py", line 3483, in __str__
    return repr(self)
  File "/localdisk/aprutsko/modin/modin/pandas/series.py", line 298, in __repr__
    temp_df = temp_df.iloc[:, 0]
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/pandas/core/indexing.py", line 1762, in __getitem__
    return self._getitem_tuple(key)
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/pandas/core/indexing.py", line 2067, in _getitem_tuple
    self._has_valid_tuple(tup)
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/pandas/core/indexing.py", line 703, in _has_valid_tuple
    self._validate_key(k, i)
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/pandas/core/indexing.py", line 1994, in _validate_key
    self._validate_integer(key, axis)
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/pandas/core/indexing.py", line 2063, in _validate_integer
    raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds
```
I translate this issue into a bug type.
Issue with pure `modin.Series` was described in #1647 

Resolving patch:
diff --git a/modin/pandas/series.py b/modin/pandas/series.py
--- a/modin/pandas/series.py
+++ b/modin/pandas/series.py
@@ -308,6 +308,11 @@ def __repr__(self):
         if isinstance(temp_df, pandas.DataFrame) and not temp_df.empty:
             temp_df = temp_df.iloc[:, 0]
         temp_str = repr(temp_df)
+        freq_str = (
+            "Freq: {}, ".format(self.index.freqstr)
+            if isinstance(self.index, pandas.DatetimeIndex)
+            else ""
+        )
         if self.name is not None:
             name_str = "Name: {}, ".format(str(self.name))
         else:
@@ -322,9 +327,9 @@ def __repr__(self):
             else temp_str.rsplit("dtype: ", 1)[-1]
         )
         if len(self) == 0:
-            return "Series([], {}{}".format(name_str, dtype_str)
-        return temp_str.rsplit("\nName:", 1)[0] + "\n{}{}{}".format(
-            name_str, len_str, dtype_str
+            return "Series([], {}{}{}".format(freq_str, name_str, dtype_str)
+        return temp_str.rsplit("\n", 1)[0] + "\n{}{}{}{}".format(
+            freq_str, name_str, len_str, dtype_str
         )
 
     def __round__(self, decimals=0):


Test patch:
diff --git a/modin/pandas/test/test_series.py b/modin/pandas/test/test_series.py
--- a/modin/pandas/test/test_series.py
+++ b/modin/pandas/test/test_series.py
@@ -474,14 +474,24 @@ def test___pow__(data):
     inter_df_math_helper(modin_series, pandas_series, "__pow__")
 
 
-def test___repr___empty():
-    modin_series, pandas_series = pd.Series(), pandas.Series()
-    assert repr(modin_series) == repr(pandas_series)
-
-
-@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
-def test___repr__(data):
-    modin_series, pandas_series = create_test_series(data)
+@pytest.mark.parametrize("name", ["Dates", None])
+@pytest.mark.parametrize(
+    "dt_index", [True, False], ids=["dt_index_true", "dt_index_false"]
+)
+@pytest.mark.parametrize(
+    "data", [*test_data_values, "empty"], ids=[*test_data_keys, "empty"]
+)
+def test___repr__(name, dt_index, data):
+    if data == "empty":
+        modin_series, pandas_series = pd.Series(), pandas.Series()
+    else:
+        modin_series, pandas_series = create_test_series(data)
+    pandas_series.name = modin_series.name = name
+    if dt_index:
+        index = pandas.date_range(
+            "1/1/2000", periods=len(pandas_series.index), freq="T"
+        )
+        pandas_series.index = modin_series.index = index
     assert repr(modin_series) == repr(pandas_series)