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/01/19 22:30:12 UTC

[GitHub] [spark] zero323 commented on a change in pull request #34293: [SPARK-37014][PYTHON] Inline type hints for python/pyspark/streaming/context.py

zero323 commented on a change in pull request #34293:
URL: https://github.com/apache/spark/pull/34293#discussion_r788199973



##########
File path: python/pyspark/streaming/context.py
##########
@@ -264,7 +280,9 @@ def checkpoint(self, directory):
         """
         self._jssc.checkpoint(directory)
 
-    def socketTextStream(self, hostname, port, storageLevel=StorageLevel.MEMORY_AND_DISK_2):
+    def socketTextStream(
+        self, hostname: str, port: int, storageLevel: StorageLevel = StorageLevel.MEMORY_AND_DISK_2
+    ) -> "DStream[str]":

Review comment:
       > We need to wait to inline type hints `python/pyspark/streaming/dstream.py` and have `DStream(Generic[T_co])` before use `DStream[str]` directly
   
   Why do say that? `DStream` is already generic within stubs.




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