ueshin commented on code in PR #49299:
URL: https://github.com/apache/spark/pull/49299#discussion_r1898074693


##########
python/pyspark/worker.py:
##########
@@ -1049,7 +1049,7 @@ def eval(self, *args, **kwargs) -> Iterator:
                 list(args) + list(kwargs.values())
             )
             if changed_partitions:
-                if self._udtf.terminate is not None:
+                if hasattr(self._udtf, "terminate") and self._udtf.terminate 
is not None:

Review Comment:
   We should fix 
https://github.com/apache/spark/blob/8a2cd4710ea3cba9806537f83af0e6522d68062f/python/pyspark/worker.py#L1078
 too?



##########
python/pyspark/worker.py:
##########
@@ -1049,7 +1049,7 @@ def eval(self, *args, **kwargs) -> Iterator:
                 list(args) + list(kwargs.values())
             )
             if changed_partitions:
-                if self._udtf.terminate is not None:
+                if hasattr(self._udtf, "terminate") and self._udtf.terminate 
is not None:

Review Comment:
   I don't think we need `and ...`.



-- 
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