File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
python/pyspark/sql/streaming Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -64,19 +64,17 @@ class StreamingQueryListener(ABC):
64
64
"""
65
65
66
66
def _set_spark_session (
67
- self , spark : "SparkSession" # type: ignore[name-defined] # noqa: F821
67
+ self , session : "SparkSession" # type: ignore[name-defined] # noqa: F821
68
68
) -> None :
69
- self ._sparkSession = spark
69
+ if self .spark is not None :
70
+ self .spark = session
70
71
71
72
@property
72
73
def spark (self ) -> Optional ["SparkSession" ]: # type: ignore[name-defined] # noqa: F821
73
- if hasattr (self , "_sparkSession" ):
74
- return self ._sparkSession
75
- else :
76
- return None
74
+ return getattr (self , "_sparkSession" , None )
77
75
78
76
@spark .setter
79
- def spark (self , session ):
77
+ def spark (self , session ) -> None :
80
78
# For backward compatibility
81
79
self ._sparkSession = session
82
80
You can’t perform that action at this time.
0 commit comments