You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/07 10:01:09 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #34825: [SPARK-37563][PYTHON] Implement days, seconds, microseconds properties of TimedeltaIndex

HyukjinKwon commented on a change in pull request #34825:
URL: https://github.com/apache/spark/pull/34825#discussion_r763829679



##########
File path: python/pyspark/pandas/indexes/timedelta.py
##########
@@ -111,3 +115,66 @@ def __getattr__(self, item: str) -> Any:
                 return partial(property_or_func, self)
 
         raise AttributeError("'TimedeltaIndex' object has no attribute '{}'".format(item))
+
+    @property
+    def days(self) -> Index:
+        """
+        Number of days for each element.
+        """
+        sdf = self._internal.spark_frame.select(

Review comment:
       Hm .. shouldn't we use `self.spark.column` or with `_with_new_scol` instead of doing a select? Otherwise, the output will have a different anchor.




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