zhengruifeng commented on code in PR #38278:
URL: https://github.com/apache/spark/pull/38278#discussion_r996627047
##########
python/pyspark/testing/connectutils.py:
##########
@@ -47,6 +49,9 @@ def __init__(self) -> None:
def set_hook(self, name: str, hook: Any) -> None:
self.hooks[name] = hook
+ def drop_hook(self, name: str) -> None:
+ self.hooks.pop(name)
Review Comment:
should we catch the exceptions if `self.hooks` do not contains `name`?
##########
python/pyspark/testing/connectutils.py:
##########
@@ -58,7 +63,23 @@ class PlanOnlyTestFixture(unittest.TestCase):
connect: "MockRemoteSession"
+ @classmethod
+ def _read_table(cls, table_name: str) -> "DataFrame":
+ return DataFrame.withPlan(Read(table_name), cls.connect) # type:
ignore
+
+ @classmethod
+ def _udf_mock(cls, *args, **kwargs):
Review Comment:
nit:
```suggestion
def _udf_mock(cls, *args, **kwargs) -> str:
```
--
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]