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

Tian Gao resolved SPARK-60174.
------------------------------
    Fix Version/s: 4.4.0
       Resolution: Fixed

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

> Remove type: ignore[union-attr] in pyspark.sql.worker.utils
> -----------------------------------------------------------
>
>                 Key: SPARK-60174
>                 URL: https://issues.apache.org/jira/browse/SPARK-60174
>             Project: Spark
>          Issue Type: Improvement
>          Components: PySpark, Tests
>    Affects Versions: 4.4.0
>            Reporter: Anna Liang
>            Assignee: Anna Liang
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.4.0
>
>
> `worker_run` in python/pyspark/sql/worker/utils.py suppresses a mypy 
> `union-attr` error on `sys.modules["__main__"].__spec__.name` with
> `# type: ignore[union-attr]`, because `{_}{{_}}spec{{_}}{_}` is typed as
> `ModuleSpec | None`.
> Narrow the type explicitly by storing `{_}{{_}}spec{{_}}{_}` in a local 
> variable and
> checking `is not None`, then remove the `type: ignore`. Behavior is unchanged.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to