uros-b commented on code in PR #56624:
URL: https://github.com/apache/spark/pull/56624#discussion_r3444988936


##########
python/pyspark/pandas/data_type_ops/timedelta_ops.py:
##########
@@ -72,6 +73,35 @@ def restore(self, col: pd.Series) -> pd.Series:
         else:
             return col.astype(self.dtype)
 
+    def _with_inferred_unit(

Review Comment:
   Tiny overhead: _with_inferred_unit rebuilds the field on every subtraction 
on pandas 3 even when the result is already us (the common case). An early `if 
promoted == us: return result` would avoid the extra _with_new_scol.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to