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

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #40420: [SPARK-42617][PS] Support `isocalendar` from the pandas 2.0.0

HyukjinKwon commented on code in PR #40420:
URL: https://github.com/apache/spark/pull/40420#discussion_r1136370080


##########
python/pyspark/pandas/datetimes.py:
##########
@@ -116,26 +118,50 @@ def pandas_microsecond(s) -> ps.Series[np.int64]:  # type: ignore[no-untyped-def
     def nanosecond(self) -> "ps.Series":
         raise NotImplementedError()
 
-    # TODO(SPARK-42617): Support isocalendar.week and replace it.
-    # See also https://github.com/pandas-dev/pandas/pull/33595.
-    @property
-    def week(self) -> "ps.Series":
-        """
-        The week ordinal of the year.
-
-        .. deprecated:: 3.4.0
+    def isocalendar(self) -> "ps.DataFrame":
         """
-        warnings.warn(
-            "weekofyear and week have been deprecated.",
-            FutureWarning,
+        Calculate year, week, and day according to the ISO 8601 standard.
+        Returns
+        -------
+        DataFrame
+            With columns year, week and day.

Review Comment:
   ```suggestion
               With columns year, week and day.
   
   ```



##########
python/pyspark/pandas/datetimes.py:
##########
@@ -116,26 +118,50 @@ def pandas_microsecond(s) -> ps.Series[np.int64]:  # type: ignore[no-untyped-def
     def nanosecond(self) -> "ps.Series":
         raise NotImplementedError()
 
-    # TODO(SPARK-42617): Support isocalendar.week and replace it.
-    # See also https://github.com/pandas-dev/pandas/pull/33595.
-    @property
-    def week(self) -> "ps.Series":
-        """
-        The week ordinal of the year.
-
-        .. deprecated:: 3.4.0
+    def isocalendar(self) -> "ps.DataFrame":
         """
-        warnings.warn(
-            "weekofyear and week have been deprecated.",
-            FutureWarning,
+        Calculate year, week, and day according to the ISO 8601 standard.

Review Comment:
   ```suggestion
           Calculate year, week, and day according to the ISO 8601 standard.
   
   ```



-- 
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