xinrong-meng commented on code in PR #51090:
URL: https://github.com/apache/spark/pull/51090#discussion_r2150928292
##########
python/pyspark/pandas/correlation.py:
##########
@@ -219,6 +224,43 @@ def compute(sdf: SparkDataFrame, groupKeys: List[str],
method: str) -> SparkData
F.col(CORRELATION_VALUE_2_COLUMN) ==
F.col(CORRELATION_VALUE_Y_COLUMN)
)
+ spark_session = SparkSession.getActiveSession()
+ if is_ansi_mode_enabled(spark_session):
Review Comment:
My understanding is F.try_divide(a, b) returns NULL if b == 0 regardless of
ANSI. But a / b throws error on b == 0, and behaves like native Python when
ANSI off. Please let me know if I misunderstand anything
--
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]