You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "itholic (via GitHub)" <gi...@apache.org> on 2023/04/24 03:37:09 UTC

[GitHub] [spark] itholic commented on a diff in pull request #40370: [SPARK-42620][PS] Add `inclusive` parameter for (DataFrame|Series).between_time

itholic commented on code in PR #40370:
URL: https://github.com/apache/spark/pull/40370#discussion_r1174748478


##########
python/pyspark/pandas/frame.py:
##########
@@ -3582,14 +3571,18 @@ def between_time(
         if not isinstance(self.index, ps.DatetimeIndex):
             raise TypeError("Index must be DatetimeIndex")
 
+        if inclusive not in ["left", "right", "both", "neither"]:
+            msg = "Inclusive has to be either 'both', 'neither', 'left' or 'right'"
+            raise ValueError(msg)

Review Comment:
   Can we use `PySparkValueError` and error classes?



##########
python/pyspark/pandas/frame.py:
##########
@@ -3519,16 +3516,8 @@ def between_time(
             Initial time as a time filter limit.
         end_time : datetime.time or str
             End time as a time filter limit.
-        include_start : bool, default True
-            Whether the start time needs to be included in the result.
-
-            .. deprecated:: 3.4.0
-
-        include_end : bool, default True
-            Whether the end time needs to be included in the result.
-
-            .. deprecated:: 3.4.0
-
+        inclusive : {"both", "neither", "left", "right"}, default "both"
+            Include boundaries; whether to set each bound as closed or open.

Review Comment:
   Let's add `versionadded`



##########
python/pyspark/pandas/series.py:
##########
@@ -6836,16 +6833,8 @@ def between_time(
             Initial time as a time filter limit.
         end_time : datetime.time or str
             End time as a time filter limit.
-        include_start : bool, default True
-            Whether the start time needs to be included in the result.
-
-            .. deprecated:: 3.4.0
-
-        include_end : bool, default True
-            Whether the end time needs to be included in the result.
-
-            .. deprecated:: 3.4.0
-
+        inclusive : {"both", "neither", "left", "right"}, default "both"
+            Include boundaries; whether to set each bound as closed or open.

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org