[ https://issues.apache.org/jira/browse/SPARK-36220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17383727#comment-17383727 ]
Apache Spark commented on SPARK-36220: -------------------------------------- User 'tobiasedwards' has created a pull request for this issue: https://github.com/apache/spark/pull/33428 > Incorrect pyspark.sql.types.Row __new__ and __init__ type annotations > --------------------------------------------------------------------- > > Key: SPARK-36220 > URL: https://issues.apache.org/jira/browse/SPARK-36220 > Project: Spark > Issue Type: Bug > Components: PySpark > Affects Versions: 3.1.2 > Reporter: Tobias Edwards > Priority: Minor > > This bug involves incorrect type annotations for {{pyspark.sql.types.Row}}'s > {{\_\_new\_\_}} and {{\_\_init\_\_}} methods when invoked without keyword > arguments (_i.e._, {{\*args}} rather than {{\*\*kwargs}}). > When creating a > [Row|https://hyukjin-spark.readthedocs.io/en/latest/reference/api/pyspark.sql.types.Row.html] > with unnamed fields which are not of type {{str}} (_e.g._, {{row1 = > Row("Alice", 11)}} appears in the {{Row}} documentation) type checkers > produce an error. > The implementation doesn't assume the arguments are of type {{str}}, and in > fact the documentation includes an example where non-{{str}} types are > provided in this way (see [the final example > here|https://hyukjin-spark.readthedocs.io/en/latest/reference/api/pyspark.sql.types.Row.html]). > An example of the type error produced by > [pyright|https://github.com/microsoft/pyright] is > {code} > error: No overloads for "__init__" match the provided arguments > Argument types: (Literal['Alice'], Literal[11]) (reportGeneralTypeIssues) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org