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


##########
python/pyspark/pandas/datetimes.py:
##########
@@ -116,26 +117,59 @@ def pandas_microsecond(s) -> ps.Series[np.int32]:  # 
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":
+    def isocalendar(self) -> "ps.DataFrame":
         """
-        The week ordinal of the year.
+        Calculate year, week, and day according to the ISO 8601 standard.
 
-        .. deprecated:: 3.4.0
-        """
-        warnings.warn(
-            "weekofyear and week have been deprecated.",
-            FutureWarning,
-        )
-        return self._data.spark.transform(lambda c: 
F.weekofyear(c).cast(LongType()))
+            .. versionadded:: 4.0.0
 
-    @property
-    def weekofyear(self) -> "ps.Series":
-        return self.week
+        Returns
+        -------
+        DataFrame
+            With columns year, week and day.
 
-    weekofyear.__doc__ = week.__doc__
+        .. note:: Returns have int64 type instead of UInt32 as is in pandas 
due to UInt32
+            is not supported by spark
+
+        Examples
+        --------

Review Comment:
   Sure! It's not very urgent, so please take your time



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to