[ 
https://issues.apache.org/jira/browse/SPARK-57233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ruifeng Zheng resolved SPARK-57233.
-----------------------------------
    Fix Version/s: 4.3.0
       Resolution: Fixed

Issue resolved by pull request 56251
[https://github.com/apache/spark/pull/56251]

> SparkSession.sql() type hint is incomplete
> ------------------------------------------
>
>                 Key: SPARK-57233
>                 URL: https://issues.apache.org/jira/browse/SPARK-57233
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 3.5.8
>            Reporter: Jonathan Dayton
>            Assignee: Jonathan Dayton
>            Priority: Trivial
>              Labels: pull-request-available
>             Fix For: 4.3.0
>
>
> Spark 3.5 added support for positional parameters in {{SparkSession.sql()}}'s 
> {{args}} parameter. The type hint for positional parameters is a 
> non-subscripted container ({{List}} instead of {{List[ElementType]}}). As a 
> result, the type of this function is partially unknown, which causes an error 
> in Pylance (strict mode) anytime this function is used.
> {code:python}
> from pyspark.sql import SparkSession
> def repro(spark: SparkSession):
>     df = spark.sql("SELECT * FROM my_table")  # Error: Type of "sql" is 
> partially unknown
>     df.show()
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to