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/12/06 06:30:15 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #38879: [SPARK-41362][CONNECT][PYTHON] Better error messages for invalid argument types.

HyukjinKwon commented on code in PR #38879:
URL: https://github.com/apache/spark/pull/38879#discussion_r1040549249


##########
python/pyspark/sql/connect/plan.py:
##########
@@ -249,6 +280,7 @@ class Project(LogicalPlan):
     def __init__(self, child: Optional["LogicalPlan"], *columns: "ColumnOrName") -> None:
         super().__init__(child)
         self._raw_columns = list(columns)
+        _all_of(self._raw_columns, ColumnOrName)

Review Comment:
   Hm .. typing instances aren't actually supposed to be used runtime type checking. In addition, `_all_of` implementation seems like extracting the arguments from the type hints which won't cover a case like `Dict[str, int]`.
   
   My understanding of adding type hints is also to avoid such type checking on each argument so I don't feel strongly on this change to be honest.
   
   Adding @zero323 who has a better insight in this.



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