holdenk commented on code in PR #54580:
URL: https://github.com/apache/spark/pull/54580#discussion_r2875296162


##########
python/pyspark/logger/worker_io.py:
##########
@@ -223,7 +223,11 @@ def context_provider() -> dict[str, str]:
             - class_name: Name of the class that initiated the logging if 
available
     """
 
-    def is_pyspark_module(module_name: str) -> bool:
+    def is_pyspark_module(frame: FrameType) -> bool:
+        module_name = frame.f_globals.get("__name__", "")
+        if module_name == "__main__":
+            if mod := sys.modules.get("__main__", None):
+                module_name = mod.__spec__.name

Review Comment:
   just so i understand, these logging changes were needed/discovered after 
adding the test or just a cleanup?



-- 
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