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



##########
File path: python/pyspark/resource/profile.pyi
##########
@@ -22,30 +22,39 @@ from pyspark.resource.requests import (  # noqa: F401
     TaskResourceRequest as TaskResourceRequest,
     TaskResourceRequests as TaskResourceRequests,
 )
-from typing import Any, Optional
+from typing import overload, Dict, Optional, Union
+from py4j.java_gateway import JavaObject  # type: ignore
 
 class ResourceProfile:
+    @overload
     def __init__(
         self,
-        _java_resource_profile: Optional[Any] = ...,
-        _exec_req: Any = ...,
-        _task_req: Any = ...,
+        _java_resource_profile: Optional[JavaObject] = ...,
+    ) -> None: ...
+    @overload
+    def __init__(
+        self,
+        *,

Review comment:
       > ohh got it. NVM. the codes assumes it.
   
   Yeah, it is all about control flow there. But this
   
   ```
       @overload
       def __init__(
           self,
           _java_resource_profile: None = ...,
           _exec_req: Dict[str, ExecutorResourceRequest] = ...,
           _task_req: Dict[str, TaskResourceRequest] = ...,
       ) -> None: ...
   ```
   
   should have the same meaning here.




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

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