itholic commented on code in PR #46215:
URL: https://github.com/apache/spark/pull/46215#discussion_r1578936273


##########
python/pyspark/errors/utils.py:
##########
@@ -197,6 +197,16 @@ def with_origin_to_class(cls: Type[T]) -> Type[T]:
     """
     if os.environ.get("PYSPARK_PIN_THREAD", "true").lower() == "true":
         for name, method in cls.__dict__.items():
-            if callable(method) and name != "__init__":
+            # Excluding Python magic methods that do not utilize JVM functions.
+            if callable(method) and name not in (
+                "__init__",
+                "__new__",
+                "__getattr__",
+                "__getitem__",

Review Comment:
   Ah, yes we should remove `__getitem__` from the list but can we keep 
`__getattr__` here as it is?
   
   Because `__getattr__` eventually calls `__getitem__` so the call site always 
overwritten by `__getitem__` in the end.



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