Hyukjin Kwon created SPARK-62317:
------------------------------------

             Summary: Keep the RecursionError of a child's needConversion, the 
depth of the StructType constructor, and the os global of pyspark.sql.types as 
in PySpark
                 Key: SPARK-62317
                 URL: https://issues.apache.org/jira/browse/SPARK-62317
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: 5.0.0
            Reporter: Hyukjin Kwon


Follow-ups of SPARK-62310 (needConversion dispatch), found in a post-merge 
review against PySpark 4.3.0:

1. The drop-in rewrites the text of a RecursionError of a child's 
needConversion to "maximum recursion depth exceeded" even when the error is a 
subclass of RecursionError, or comes from a Python override (where PySpark 
keeps "... while calling a Python object"); it also replaces the exception 
object, losing its type and the user's traceback frames.
2. The StructType constructor allows 2 more nesting levels than PySpark's (993 
vs 991 at recursion limit 1000 on Python 3.11), because PySpark's __init__ and 
list-comprehension frames count.
3. pyspark.sql.types has no `os` attribute, so 
mock.patch.dict("pyspark.sql.types.os.environ", ...) raises AttributeError, and 
a patch of the module's `os` is not seen by 
YearMonthIntervalType.needConversion.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to