Repository: modin-project/modin

Issue:
New API: `between_time` for Series and DataFrame

### Describe the problem
<!-- Describe the problem clearly here. -->
It should be relatively easy to add implementation for `between_time` for both `Series` and `DataFrame`. It is a filter on the index, so it should work well with existing functionality.


Discussion:

Resolving patch:
diff --git a/modin/pandas/base.py b/modin/pandas/base.py
--- a/modin/pandas/base.py
+++ b/modin/pandas/base.py
@@ -642,14 +642,12 @@ def at_time(self, time, asof=False, axis=None):
     def between_time(
         self, start_time, end_time, include_start=True, include_end=True, axis=None
     ):
-        return self._default_to_pandas(
-            "between_time",
-            start_time,
-            end_time,
-            include_start=include_start,
-            include_end=include_end,
-            axis=axis,
+        axis = self._get_axis_number(axis) if axis is not None else 0
+        idx = self.index if axis == 0 else self.columns
+        indexer = idx.indexer_between_time(
+            start_time, end_time, include_start=include_start, include_end=include_end
         )
+        return self.iloc[indexer] if axis == 0 else self.iloc[:, indexer]
 
     def bfill(self, axis=None, inplace=False, limit=None, downcast=None):
         """Synonym for DataFrame.fillna(method='bfill')"""


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
@@ -2178,10 +2178,25 @@ def test_at_time(self):
         )
 
     def test_between_time(self):
-        i = pd.date_range("2018-04-09", periods=4, freq="12H")
-        ts = pd.DataFrame({"A": [1, 2, 3, 4]}, index=i)
-        with pytest.warns(UserWarning):
-            ts.between_time("0:15", "0:45")
+        i = pd.date_range("2008-01-01", periods=1000, freq="12H")
+        modin_df = pd.DataFrame(
+            {"A": list(range(1000)), "B": list(range(1000))}, index=i
+        )
+        pandas_df = pandas.DataFrame(
+            {"A": list(range(1000)), "B": list(range(1000))}, index=i
+        )
+        df_equals(
+            modin_df.between_time("12:00", "17:00"),
+            pandas_df.between_time("12:00", "17:00"),
+        )
+        df_equals(
+            modin_df.between_time("3:00", "4:00"),
+            pandas_df.between_time("3:00", "4:00"),
+        )
+        df_equals(
+            modin_df.T.between_time("12:00", "17:00", axis=1),
+            pandas_df.T.between_time("12:00", "17:00", axis=1),
+        )
 
     def test_bfill(self):
         test_data = TestData()
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
@@ -858,10 +858,21 @@ def test_between():
 
 
 def test_between_time():
-    i = pd.date_range("2018-04-09", periods=4, freq="12H")
-    ts = pd.Series([1, 2, 3, 4], index=i)
-    with pytest.warns(UserWarning):
-        ts.between_time("0:15", "0:45")
+    i = pd.date_range("2008-01-01", periods=1000, freq="12H")
+    modin_series = pd.Series(list(range(1000)), index=i)
+    pandas_series = pandas.Series(list(range(1000)), index=i)
+    df_equals(
+        modin_series.between_time("12:00", "17:00"),
+        pandas_series.between_time("12:00", "17:00"),
+    )
+    df_equals(
+        modin_series.between_time("3:00", "8:00"),
+        pandas_series.between_time("3:00", "8:00"),
+    )
+    df_equals(
+        modin_series.between_time("3:00", "8:00", False),
+        pandas_series.between_time("3:00", "8:00", False),
+    )
 
 
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)