xinrong-databricks commented on code in PR #36246: URL: https://github.com/apache/spark/pull/36246#discussion_r853366468
########## python/pyspark/pandas/series.py: ########## @@ -2209,15 +2219,43 @@ def _interpolate( ) * null_index_forward + last_non_null_forward fill_cond = ~F.isnull(last_non_null_backward) & ~F.isnull(last_non_null_forward) - pad_cond = F.isnull(last_non_null_backward) & ~F.isnull(last_non_null_forward) - if limit is not None: - fill_cond = fill_cond & (null_index_forward <= F.lit(limit)) - pad_cond = pad_cond & (null_index_forward <= F.lit(limit)) + + pad_head = SF.lit(None) Review Comment: nit: How about adding a comment or extracting the logic below as a separate method? The method `_interpolate` seems too long to follow. -- 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