Repository: modin-project/modin

Issue:
After pd.set_option('display.max_rows', None), df.describe().T only displays 60 rows
### System information
- OS: macOS 12.4
- Modin version: 0.15.2
- Python version: 3.9.12 (Anaconda)
- **Code we can use to reproduce**:
In Jupyter nbotebook:

```
import os
os.environ["MODIN_ENGINE"] = "ray"
import modin.pandas as pd
import numpy as np
import ray
ray.init()
pd.set_option('display.max_rows', None)
df = pd.DataFrame(np.zeros((2,100)))
df.describe().T
```
<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
<!-- Describe the problem clearly here. -->

After running
```
pd.set_option('display.max_rows', None), df.describe().T only displays 60 rows
```
to display all rows of output, df.describe().T shows the first 30 rows and last 30 rows only, with no indication that you're not seeing all of the output.

### 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:
@rhstanton thank you for reporting this issue! I can reproduce it at Modin version 910bf2dd893f52072c2c25413bf0866825f8309d:

```python
import modin.pandas as pd
pd.set_option('display.max_rows', None)
print(pd.DataFrame(list(range(20))))
```

the above script gives me just 12 rows in my terminal in ipython, while pandas gives me all 20 rows.

To whomever works on the fix:
I tried passing `num_rows = len(self.index)` to [`modin.pandas.BasePandasDataset._build_repr_df`](https://github.com/modin-project/modin/blob/910bf2dd893f52072c2c25413bf0866825f8309d/modin/pandas/base.py#L135) in case `display.max_rows` is `None` (and likewise for columns), but that's not passing the modified unit test `test__options_display` with `max_rows = max_cols = None`. However, setting `max_rows` to `math.inf` with special treatment so we don't try to divide infinity worked. The latter solution doesn't seem as clear, though.
This seems like low hanging fruit that we should fix in an effort to improve user experience. 

Resolving patch:
diff --git a/modin/pandas/__init__.py b/modin/pandas/__init__.py
--- a/modin/pandas/__init__.py
+++ b/modin/pandas/__init__.py
@@ -41,7 +41,11 @@
         Timestamp,
         set_eng_float_format,
         options,
+        describe_option,
         set_option,
+        get_option,
+        reset_option,
+        option_context,
         NaT,
         PeriodIndex,
         Categorical,
@@ -290,7 +294,11 @@ def init_remote_ray(partition):
     "to_timedelta",
     "set_eng_float_format",
     "options",
+    "describe_option",
     "set_option",
+    "get_option",
+    "reset_option",
+    "option_context",
     "CategoricalIndex",
     "Timedelta",
     "Timestamp",
diff --git a/modin/pandas/dataframe.py b/modin/pandas/dataframe.py
--- a/modin/pandas/dataframe.py
+++ b/modin/pandas/dataframe.py
@@ -224,29 +224,8 @@ def __repr__(self):
         -------
         str
         """
-        from pandas.io.formats import console
-
-        num_rows = pandas.get_option("display.max_rows") or 10
-        num_cols = pandas.get_option("display.max_columns") or 20
-        if pandas.get_option("display.max_columns") is None and pandas.get_option(
-            "display.expand_frame_repr"
-        ):
-            width, _ = console.get_console_size()
-            width = min(width, len(self.columns))
-            col_counter = 0
-            i = 0
-            while col_counter < width:
-                col_counter += len(str(self.columns[i])) + 1
-                i += 1
-
-            num_cols = i
-            i = len(self.columns) - 1
-            col_counter = 0
-            while col_counter < width:
-                col_counter += len(str(self.columns[i])) + 1
-                i -= 1
-
-            num_cols += len(self.columns) - i
+        num_rows = pandas.get_option("display.max_rows") or len(self.index)
+        num_cols = pandas.get_option("display.max_columns") or len(self.columns)
         result = repr(self._build_repr_df(num_rows, num_cols))
         if len(self.index) > num_rows or len(self.columns) > num_cols:
             # The split here is so that we don't repr pandas row lengths.


Test patch:
diff --git a/modin/pandas/test/dataframe/test_iter.py b/modin/pandas/test/dataframe/test_iter.py
--- a/modin/pandas/test/dataframe/test_iter.py
+++ b/modin/pandas/test/dataframe/test_iter.py
@@ -111,31 +111,26 @@ def test___contains__(request, data):
         assert result == (key in modin_df)
 
 
-def test__options_display():
-    frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(1000, 102))
+@pytest.mark.parametrize("expand_frame_repr", [False, True])
+@pytest.mark.parametrize("max_rows_columns", [(5, 5), (10, 10), (75, 75), (None, None)])
+def test__options_display(max_rows_columns, expand_frame_repr):
+    frame_data = random_state.randint(RAND_LOW, RAND_HIGH, size=(102, 102))
     pandas_df = pandas.DataFrame(frame_data)
     modin_df = pd.DataFrame(frame_data)
 
-    pandas.options.display.max_rows = 10
-    pandas.options.display.max_columns = 10
-    x = repr(pandas_df)
-    pd.options.display.max_rows = 5
-    pd.options.display.max_columns = 5
-    y = repr(modin_df)
-    assert x != y
-    pd.options.display.max_rows = 10
-    pd.options.display.max_columns = 10
-    y = repr(modin_df)
-    assert x == y
-
-    # test for old fixed max values
-    pandas.options.display.max_rows = 75
-    pandas.options.display.max_columns = 75
-    x = repr(pandas_df)
-    pd.options.display.max_rows = 75
-    pd.options.display.max_columns = 75
-    y = repr(modin_df)
-    assert x == y
+    context_arg = [
+        "display.max_rows",
+        max_rows_columns[0],
+        "display.max_columns",
+        max_rows_columns[1],
+        "display.expand_frame_repr",
+        expand_frame_repr,
+    ]
+    with pd.option_context(*context_arg):
+        modin_df_repr = repr(modin_df)
+    with pandas.option_context(*context_arg):
+        pandas_df_repr = repr(pandas_df)
+    assert modin_df_repr == pandas_df_repr
 
 
 def test___finalize__():
diff --git a/modin/pandas/test/test_api.py b/modin/pandas/test/test_api.py
--- a/modin/pandas/test/test_api.py
+++ b/modin/pandas/test/test_api.py
@@ -39,10 +39,6 @@ def test_top_level_api_equality():
         "tseries",
         "errors",
         "to_msgpack",  # This one is experimental, and doesn't look finished
-        "describe_option",
-        "get_option",
-        "option_context",
-        "reset_option",
         "Panel",  # This is deprecated and throws a warning every time.
         "SparseSeries",  # depreceted since pandas 1.0, not present in 1.4+
         "SparseDataFrame",  # depreceted since pandas 1.0, not present in 1.4+