You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/17 05:32:57 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #38278: [SPARK-40809][SPARK-40780][FOLLOW-UP] Improve filter and alias testing coverage in python client

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org