xinrong-meng commented on code in PR #49055:
URL: https://github.com/apache/spark/pull/49055#discussion_r1897740992
##########
python/pyspark/sql/tests/test_udtf.py:
##########
@@ -1064,6 +1074,71 @@ def eval(self, row: Row):
func = udtf(TestUDTF, returnType="a: int")
return func
+ def test_df_asTable_chaining_methods(self):
+ class TestUDTF:
+ def eval(self, row: Row):
+ yield row["key"], row["value"]
+
+ def terminate(self):
+ if False:
+ yield
Review Comment:
That is necessary with "partitionBy" otherwise we will hit
```
AttributeError: 'TestUDTF' object has no attribute 'terminate'
```
because of
https://github.com/apache/spark/blob/master/python/pyspark/worker.py#L1052.
I will file a fix separately.
--
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]