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 2021/10/06 13:33:08 UTC

[GitHub] [spark] dchvn opened a new pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspar…

dchvn opened a new pull request #34197:
URL: https://github.com/apache/spark/pull/34197


   ### What changes were proposed in this pull request?
   Inline type hints for python/pyspark/sql/group.py from Inline type hints for python/pyspark/sql/group.pyi.
   
   ### Why are the changes needed?
   Currently, there is type hint stub files python/pyspark/sql/group.pyi to show the expected types for functions, but we can also take advantage of static type checking within the functions by inlining the type hints.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Existed test.


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936367348


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48391/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941897856


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48652/
   


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


[GitHub] [spark] dchvn commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r727651691



##########
File path: python/pyspark/sql/group.py
##########
@@ -53,12 +64,12 @@ class GroupedData(PandasGroupedOpsMixin):
     .. versionadded:: 1.3
     """
 
-    def __init__(self, jgd, df):
+    def __init__(self, jgd: JavaObject, df: DataFrame) -> None:
         self._jgd = jgd
         self._df = df
-        self.sql_ctx = df.sql_ctx
+        self.sql_ctx: SQLContext = df.sql_ctx
 
-    def agg(self, *exprs):
+    def agg(self, *exprs: Column) -> DataFrame:

Review comment:
       Thanks, my mistake!
   Updated, Please take a look when you have time!




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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941867045


   **[Test build #144174 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144174/testReport)** for PR 34197 at commit [`514a6f1`](https://github.com/apache/spark/commit/514a6f1b01fc3de67f9ad5066179d9851d3e080e).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936298722


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143880/
   


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


[GitHub] [spark] AmplabJenkins commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942908316


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48701/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936517108


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48391/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936298659


   **[Test build #143880 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143880/testReport)** for PR 34197 at commit [`b331cc8`](https://github.com/apache/spark/commit/b331cc8aad2655a49b58cc6c372a490afd0026b4).
    * This patch **fails Python style tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


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


[GitHub] [spark] AmplabJenkins commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936533696






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


[GitHub] [spark] SparkQA removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941856898


   **[Test build #144174 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144174/testReport)** for PR 34197 at commit [`514a6f1`](https://github.com/apache/spark/commit/514a6f1b01fc3de67f9ad5066179d9851d3e080e).


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


[GitHub] [spark] SparkQA removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941856898


   **[Test build #144174 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144174/testReport)** for PR 34197 at commit [`514a6f1`](https://github.com/apache/spark/commit/514a6f1b01fc3de67f9ad5066179d9851d3e080e).


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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941875241


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144174/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941856898






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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942908316


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48701/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936310920


   **[Test build #143878 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143878/testReport)** for PR 34197 at commit [`5c732ab`](https://github.com/apache/spark/commit/5c732ab08c744b0c48287b83640f67dacfc06a3f).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941901968


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48652/
   


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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936533696






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


[GitHub] [spark] dchvn commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r727651785



##########
File path: python/pyspark/sql/group.py
##########
@@ -14,19 +14,27 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+from __future__ import annotations

Review comment:
       updated




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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941880534


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48652/
   


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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942884166


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144221/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936437738


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48393/
   


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


[GitHub] [spark] ueshin commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
ueshin commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r728585222



##########
File path: python/pyspark/sql/group.py
##########
@@ -17,16 +17,23 @@
 
 import sys
 
-from pyspark.sql.column import Column, _to_seq
+from typing import Callable, List, Optional, Type, TYPE_CHECKING, overload, Dict, Union, cast, Tuple
+
+if TYPE_CHECKING:
+    from pyspark.sql._typing import LiteralType
+
+from pyspark.sql.column import Column, _to_seq  # type: ignore[attr-defined]
+from pyspark.sql.context import SQLContext
 from pyspark.sql.dataframe import DataFrame
 from pyspark.sql.pandas.group_ops import PandasGroupedOpsMixin
 from pyspark.sql.types import StructType, StructField, IntegerType, StringType
+from py4j.java_gateway import JavaObject  # type: ignore[import]
 
 __all__ = ["GroupedData"]
 
 
-def dfapi(f):
-    def _api(self):
+def dfapi(f: Callable) -> Callable:
+    def _api(self: Type["GroupedData"]) -> DataFrame:

Review comment:
       It was a `@classmethod`, so it has to be `Type[Foo]`, whereas this is for instance methods.




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


[GitHub] [spark] dchvn commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r728564274



##########
File path: python/pyspark/sql/group.py
##########
@@ -17,16 +17,23 @@
 
 import sys
 
-from pyspark.sql.column import Column, _to_seq
+from typing import Callable, List, Optional, Type, TYPE_CHECKING, overload, Dict, Union, cast, Tuple
+
+if TYPE_CHECKING:
+    from pyspark.sql._typing import LiteralType
+
+from pyspark.sql.column import Column, _to_seq  # type: ignore[attr-defined]
+from pyspark.sql.context import SQLContext
 from pyspark.sql.dataframe import DataFrame
 from pyspark.sql.pandas.group_ops import PandasGroupedOpsMixin
 from pyspark.sql.types import StructType, StructField, IntegerType, StringType
+from py4j.java_gateway import JavaObject  # type: ignore[import]
 
 __all__ = ["GroupedData"]
 
 
-def dfapi(f):
-    def _api(self):
+def dfapi(f: Callable) -> Callable:
+    def _api(self: Type["GroupedData"]) -> DataFrame:

Review comment:
       @ueshin Thanks for reviewing, updated.
   But i have a question about the https://github.com/apache/spark/pull/34151#discussion_r720411372, What should we follow? cc @zero323 




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


[GitHub] [spark] dchvn commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r727651691



##########
File path: python/pyspark/sql/group.py
##########
@@ -53,12 +64,12 @@ class GroupedData(PandasGroupedOpsMixin):
     .. versionadded:: 1.3
     """
 
-    def __init__(self, jgd, df):
+    def __init__(self, jgd: JavaObject, df: DataFrame) -> None:
         self._jgd = jgd
         self._df = df
-        self.sql_ctx = df.sql_ctx
+        self.sql_ctx: SQLContext = df.sql_ctx
 
-    def agg(self, *exprs):
+    def agg(self, *exprs: Column) -> DataFrame:

Review comment:
       Thanks, my mistake!
   Updated, Please take a look when you have time!

##########
File path: python/pyspark/sql/group.py
##########
@@ -14,19 +14,27 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+from __future__ import annotations

Review comment:
       updated




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


[GitHub] [spark] AmplabJenkins commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941875241






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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942852784


   **[Test build #144221 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144221/testReport)** for PR 34197 at commit [`6ff504e`](https://github.com/apache/spark/commit/6ff504e07489b05575e85e9bbbcf89b466cc290c).


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


[GitHub] [spark] AmplabJenkins commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936298722


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143880/
   


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


[GitHub] [spark] dchvn edited a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
dchvn edited a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936345154


   CC @HyukjinKwon @ueshin @zero323 @xinrong-databricks  Please help me review this PR


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


[GitHub] [spark] AmplabJenkins commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936403060


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143878/
   


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


[GitHub] [spark] dchvn commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
dchvn commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936345154


   CC @HyukjinKwon @ueshin @zero323 @karenfeng Please help me review this PR


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


[GitHub] [spark] ueshin commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
ueshin commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r727337026



##########
File path: python/pyspark/sql/group.py
##########
@@ -53,12 +64,12 @@ class GroupedData(PandasGroupedOpsMixin):
     .. versionadded:: 1.3
     """
 
-    def __init__(self, jgd, df):
+    def __init__(self, jgd: JavaObject, df: DataFrame) -> None:
         self._jgd = jgd
         self._df = df
-        self.sql_ctx = df.sql_ctx
+        self.sql_ctx: SQLContext = df.sql_ctx
 
-    def agg(self, *exprs):
+    def agg(self, *exprs: Column) -> DataFrame:

Review comment:
       The overload definitions are missing?

##########
File path: python/pyspark/sql/group.py
##########
@@ -14,19 +14,27 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+from __future__ import annotations

Review comment:
       We can't use `annotations` future flag yet. We still support Python 3.6 as of now.

##########
File path: python/pyspark/sql/group.py
##########
@@ -53,12 +64,12 @@ class GroupedData(PandasGroupedOpsMixin):
     .. versionadded:: 1.3
     """
 
-    def __init__(self, jgd, df):
+    def __init__(self, jgd: JavaObject, df: DataFrame) -> None:

Review comment:
       nit: I don't think we need `-> None` for the initializer.




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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936403060


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143878/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942878124


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48701/
   


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


[GitHub] [spark] ueshin commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
ueshin commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r728529860



##########
File path: python/pyspark/sql/group.py
##########
@@ -17,16 +17,23 @@
 
 import sys
 
-from pyspark.sql.column import Column, _to_seq
+from typing import Callable, List, Optional, Type, TYPE_CHECKING, overload, Dict, Union, cast, Tuple
+
+if TYPE_CHECKING:
+    from pyspark.sql._typing import LiteralType
+
+from pyspark.sql.column import Column, _to_seq  # type: ignore[attr-defined]
+from pyspark.sql.context import SQLContext
 from pyspark.sql.dataframe import DataFrame
 from pyspark.sql.pandas.group_ops import PandasGroupedOpsMixin
 from pyspark.sql.types import StructType, StructField, IntegerType, StringType
+from py4j.java_gateway import JavaObject  # type: ignore[import]
 
 __all__ = ["GroupedData"]
 
 
-def dfapi(f):
-    def _api(self):
+def dfapi(f: Callable) -> Callable:
+    def _api(self: Type["GroupedData"]) -> DataFrame:

Review comment:
       `self: "GroupedData"`?

##########
File path: python/pyspark/sql/group.py
##########
@@ -17,16 +17,23 @@
 
 import sys
 
-from pyspark.sql.column import Column, _to_seq
+from typing import Callable, List, Optional, Type, TYPE_CHECKING, overload, Dict, Union, cast, Tuple
+
+if TYPE_CHECKING:
+    from pyspark.sql._typing import LiteralType

Review comment:
       Shall we put this at the end of the import block?

##########
File path: python/pyspark/sql/group.py
##########
@@ -35,10 +42,13 @@ def _api(self):
     return _api
 
 
-def df_varargs_api(f):
-    def _api(self, *cols):
+def df_varargs_api(f: Callable) -> Callable:
+    def _api(self: Type["GroupedData"], *cols: Column) -> DataFrame:

Review comment:
       Also `*cols: str`?

##########
File path: python/pyspark/sql/group.py
##########
@@ -17,16 +17,23 @@
 
 import sys
 
-from pyspark.sql.column import Column, _to_seq
+from typing import Callable, List, Optional, Type, TYPE_CHECKING, overload, Dict, Union, cast, Tuple
+
+if TYPE_CHECKING:
+    from pyspark.sql._typing import LiteralType
+
+from pyspark.sql.column import Column, _to_seq  # type: ignore[attr-defined]
+from pyspark.sql.context import SQLContext
 from pyspark.sql.dataframe import DataFrame
 from pyspark.sql.pandas.group_ops import PandasGroupedOpsMixin
 from pyspark.sql.types import StructType, StructField, IntegerType, StringType
+from py4j.java_gateway import JavaObject  # type: ignore[import]

Review comment:
       Shall we put this line between builtin libraries and pyspark?

##########
File path: python/pyspark/sql/group.py
##########
@@ -35,10 +42,13 @@ def _api(self):
     return _api
 
 
-def df_varargs_api(f):
-    def _api(self, *cols):
+def df_varargs_api(f: Callable) -> Callable:
+    def _api(self: Type["GroupedData"], *cols: Column) -> DataFrame:

Review comment:
       ditto.




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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936528505


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48393/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936297104


   **[Test build #143880 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143880/testReport)** for PR 34197 at commit [`b331cc8`](https://github.com/apache/spark/commit/b331cc8aad2655a49b58cc6c372a490afd0026b4).


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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941875241






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


[GitHub] [spark] ueshin commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
ueshin commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r727337026



##########
File path: python/pyspark/sql/group.py
##########
@@ -53,12 +64,12 @@ class GroupedData(PandasGroupedOpsMixin):
     .. versionadded:: 1.3
     """
 
-    def __init__(self, jgd, df):
+    def __init__(self, jgd: JavaObject, df: DataFrame) -> None:
         self._jgd = jgd
         self._df = df
-        self.sql_ctx = df.sql_ctx
+        self.sql_ctx: SQLContext = df.sql_ctx
 
-    def agg(self, *exprs):
+    def agg(self, *exprs: Column) -> DataFrame:

Review comment:
       The overload definitions are missing?

##########
File path: python/pyspark/sql/group.py
##########
@@ -14,19 +14,27 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+from __future__ import annotations

Review comment:
       We can't use `annotations` future flag yet. We still support Python 3.6 as of now.

##########
File path: python/pyspark/sql/group.py
##########
@@ -53,12 +64,12 @@ class GroupedData(PandasGroupedOpsMixin):
     .. versionadded:: 1.3
     """
 
-    def __init__(self, jgd, df):
+    def __init__(self, jgd: JavaObject, df: DataFrame) -> None:

Review comment:
       nit: I don't think we need `-> None` for the initializer.




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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941856898


   **[Test build #144174 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144174/testReport)** for PR 34197 at commit [`514a6f1`](https://github.com/apache/spark/commit/514a6f1b01fc3de67f9ad5066179d9851d3e080e).


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


[GitHub] [spark] AmplabJenkins commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941901968


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48652/
   


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


[GitHub] [spark] AmplabJenkins commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-941875241


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144174/
   


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


[GitHub] [spark] SparkQA removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936297104


   **[Test build #143880 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143880/testReport)** for PR 34197 at commit [`b331cc8`](https://github.com/apache/spark/commit/b331cc8aad2655a49b58cc6c372a490afd0026b4).


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


[GitHub] [spark] SparkQA removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936269750


   **[Test build #143878 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143878/testReport)** for PR 34197 at commit [`5c732ab`](https://github.com/apache/spark/commit/5c732ab08c744b0c48287b83640f67dacfc06a3f).


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942861051


   **[Test build #144221 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144221/testReport)** for PR 34197 at commit [`6ff504e`](https://github.com/apache/spark/commit/6ff504e07489b05575e85e9bbbcf89b466cc290c).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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


[GitHub] [spark] dchvn commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r728603042



##########
File path: python/pyspark/sql/group.py
##########
@@ -17,16 +17,23 @@
 
 import sys
 
-from pyspark.sql.column import Column, _to_seq
+from typing import Callable, List, Optional, Type, TYPE_CHECKING, overload, Dict, Union, cast, Tuple
+
+if TYPE_CHECKING:
+    from pyspark.sql._typing import LiteralType
+
+from pyspark.sql.column import Column, _to_seq  # type: ignore[attr-defined]
+from pyspark.sql.context import SQLContext
 from pyspark.sql.dataframe import DataFrame
 from pyspark.sql.pandas.group_ops import PandasGroupedOpsMixin
 from pyspark.sql.types import StructType, StructField, IntegerType, StringType
+from py4j.java_gateway import JavaObject  # type: ignore[import]
 
 __all__ = ["GroupedData"]
 
 
-def dfapi(f):
-    def _api(self):
+def dfapi(f: Callable) -> Callable:
+    def _api(self: Type["GroupedData"]) -> DataFrame:

Review comment:
       Thanks for explaining this to me




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


[GitHub] [spark] SparkQA removed a comment on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942852784


   **[Test build #144221 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144221/testReport)** for PR 34197 at commit [`6ff504e`](https://github.com/apache/spark/commit/6ff504e07489b05575e85e9bbbcf89b466cc290c).


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


[GitHub] [spark] AmplabJenkins commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942884166


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144221/
   


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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-936269750


   **[Test build #143878 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143878/testReport)** for PR 34197 at commit [`5c732ab`](https://github.com/apache/spark/commit/5c732ab08c744b0c48287b83640f67dacfc06a3f).


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


[GitHub] [spark] ueshin commented on a change in pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
ueshin commented on a change in pull request #34197:
URL: https://github.com/apache/spark/pull/34197#discussion_r728585222



##########
File path: python/pyspark/sql/group.py
##########
@@ -17,16 +17,23 @@
 
 import sys
 
-from pyspark.sql.column import Column, _to_seq
+from typing import Callable, List, Optional, Type, TYPE_CHECKING, overload, Dict, Union, cast, Tuple
+
+if TYPE_CHECKING:
+    from pyspark.sql._typing import LiteralType
+
+from pyspark.sql.column import Column, _to_seq  # type: ignore[attr-defined]
+from pyspark.sql.context import SQLContext
 from pyspark.sql.dataframe import DataFrame
 from pyspark.sql.pandas.group_ops import PandasGroupedOpsMixin
 from pyspark.sql.types import StructType, StructField, IntegerType, StringType
+from py4j.java_gateway import JavaObject  # type: ignore[import]
 
 __all__ = ["GroupedData"]
 
 
-def dfapi(f):
-    def _api(self):
+def dfapi(f: Callable) -> Callable:
+    def _api(self: Type["GroupedData"]) -> DataFrame:

Review comment:
       It was a class method, annotated by`@classmethod`, so it has to be `Type[Foo]`, whereas this is for instance methods.




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


[GitHub] [spark] SparkQA commented on pull request #34197: [SPARK-36938][PYTHON] Inline type hints for group.py in python/pyspark/sql

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34197:
URL: https://github.com/apache/spark/pull/34197#issuecomment-942900625


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48701/
   


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