Cannot access member "getOrCreate" for type "classproperty"

84 Views Asked by At

I am using Pyspark inside VSCode using Pylance.

from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()

I have this setting enabled:

"python.analysis.typeCheckingMode": "basic",

With this, I get this error:

Cannot access member "getOrCreate" for type "classproperty" Member "getOrCreate" is unknown Pylance (reportAttributeAccessIssue)

I haven't found any solution for this.

I read this issue: https://github.com/microsoft/pylance-release/issues/4577

But according to them, they blame pyspark, but I haven't found anyone in pyspark that is aware of this.

0

There are 0 best solutions below