You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "uros-b (via GitHub)" <gi...@apache.org> on 2026/06/20 00:02:37 UTC
Re: [PR] [SPARK-55299][PYTHON] Infer the correct unit for calculated timedeltas [spark]
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: 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