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/02/01 15:28:36 UTC

[GitHub] [spark] zero323 commented on a change in pull request #35380: [WIP][SPARK-37417][PYTHON][ML] Inline type hints for pyspark.ml.linalg.__init__.py

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



##########
File path: python/pyspark/ml/_typing.pyi
##########
@@ -75,3 +78,5 @@ RankingEvaluatorMetricType = Union[
     Literal["ndcgAtK"],
     Literal["recallAtK"],
 ]
+
+VectorLike = Union[ndarray, Vector, List[float], Tuple[float, ...]]

Review comment:
       I am not super happy about adding this here, but unless we plant to revisit something like #14263, it is probably the way to go.
   
   I was thinking about `np.typing.ArrayLike`, but we'd still need unions with our vectors, and it has much bigger impact on the hints, than simply changing the the alias.




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