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



##########
File path: python/pyspark/sql/tests/test_pandas_udf_typehints.py
##########
@@ -261,7 +261,7 @@ def plus_one(itr: Iterator[pd.Series]) -> 
Iterator[pd.Series]:
     def test_group_agg_udf_type_hint(self):
         df = self.spark.range(10).selectExpr("id", "id as v")
 
-        def weighted_mean(v: pd.Series, w: pd.Series) -> float:
+        def weighted_mean(v: pd.Series, w: pd.Series) -> np.float64:

Review comment:
       This change is required because [matching `average` 
signature](https://github.com/numpy/numpy/blob/05d908a31c0be9db3177a5e2f5a543cbeca7e4f9/numpy/lib/function_base.pyi#L117-L122)
 is shape agnostic, and while `np.float64` inherits from `float`, `np.floating` 
doesn't.
   
   We could also use `np.floating` here, but this seems to capture intent of 
the code better.




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

Reply via email to