jzhan-2026 commented on code in PR #59108:
URL: https://github.com/apache/spark/pull/59108#discussion_r4383628272
##########
python/pyspark/sql/transpile.py:
##########
@@ -912,6 +1003,15 @@ def _transpile_from_ast(
"interpreted Python"
)
converted = self._convert_chunk(params, function_body[0])
+ if self._null_guard_emitted:
+ warnings.warn(
+ "Python UDF transpiler: the transpiled UDF includes a NULL
guard "
+ "that raises at runtime when a NULL input is encountered. Add
an "
+ "`if x is not None` guard around comparisons, or filter NULLs "
+ "upstream, to avoid this.",
+ UserWarning,
+ stacklevel=2,
+ )
Review Comment:
Thanks!
--
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]