zero323 commented on a change in pull request #34892:
URL: https://github.com/apache/spark/pull/34892#discussion_r769957827



##########
File path: python/pyspark/util.py
##########
@@ -402,18 +401,16 @@ def start(self) -> None:
             # Here's when the pinned-thread mode (PYSPARK_PIN_THREAD) is on.
 
             # Local property copy should happen in Thread.start to mimic JVM's 
behavior.
-            self._props = (
-                SparkContext._active_spark_context._jsc.sc()  # type: 
ignore[attr-defined]
-                .getLocalProperties()
-                .clone()
-            )
+            assert SparkContext._active_spark_context is not None
+            self._props = 
SparkContext._active_spark_context._jsc.sc().getLocalProperties().clone()
         return super(InheritableThread, self).start()
 
     @staticmethod
     def _clean_py4j_conn_for_current_thread() -> None:
         from pyspark import SparkContext
 
         jvm = SparkContext._jvm  # type: ignore[attr-defined]

Review comment:
       We shouldn't need this ignore anymore, should we?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to