File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -185,9 +185,12 @@ def getActive(cls):
185185 # backing the supposedly active Python context
186186 activePythonContextJavaId = activePythonContext ._jssc .ssc ().hashCode ()
187187 activeJvmContextOption = activePythonContext ._jvm .StreamingContext .getActive ()
188- if activeJvmContextOption . isEmpty () or \
189- activeJvmContextOption .get (). hashCode () != activePythonContextJavaId :
188+
189+ if activeJvmContextOption .isEmpty () :
190190 cls ._activeContext = None
191+ elif activeJvmContextOption .get ().hashCode () != activePythonContextJavaId :
192+ raise Exception ("JVM's active JavaStreamingContext is not the JavaStreamingContext "
193+ "backing the action Python StreamingContext. This is unexpected." )
191194 return cls ._activeContext
192195
193196 @classmethod
You can’t perform that action at this time.
0 commit comments