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



##########
File path: python/pyspark/sql/functions.py
##########
@@ -1652,7 +1652,19 @@ def expr(str: str) -> Column:
     return Column(sc._jvm.functions.expr(str))
 
 
+@overload
 def struct(*cols: "ColumnOrName") -> Column:
+    ...
+
+
+@overload
+def struct(__cols: Union[List["ColumnOrName"], Tuple["ColumnOrName", ...]]) -> 
Column:

Review comment:
       > I know it backfires in some contexts, but maybe not here.
   
   But we'd need explicit checks for strings, like
   
   ```python
   if len(cols) == 1 and  isinstance(cols[0], Sequence) and not 
isinstance(cols[0], str):
       cols = cols[0]
   ... 
   ```




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