Hello,
I have a nested recursive proto message of the form (a simplified example) shown below:
message Abc {
string id = 1;
Abc abc_msg = 2;
}
When I do the following:
from protodf import schema_for
schema = schema_for(Abc().DESCRIPTOR)`
The function throws a RecursionError. Looks like the nested recursive structure definition throws the schema_for function. I am not sure how to fix this - thoughts, @aroch @eldandev? Perhaps, we terminate and return at some depth? Thanks!
Please see a snippet of the stacktrace below:
File "/Users/abhishek/projects/protodf-py/src/protodf/__init__.py", line 14, in <lambda>
11: lambda t: schema_for(t.message_type),
File "/Users/abhishek/projects/protodf-py/src/protodf/__init__.py", line 30, in schema_for
__type_for(field_descriptor),
File "/Users/abhishek/projects/protodf-py/src/protodf/__init__.py", line 40, in __type_for
return ArrayType(get_type(field_descriptor))
File "/Users/abhishek/projects/protodf-py/src/protodf/__init__.py", line 14, in <lambda>
11: lambda t: schema_for(t.message_type),
File "/Users/abhishek/projects/protodf-py/src/protodf/__init__.py", line 26, in schema_for
struct_type = StructType()
File "/Users/abhishek/spark/python/lib/pyspark.zip/pyspark/sql/types.py", line 496, in __init__
RecursionError: maximum recursion depth exceeded
Hello,
I have a nested recursive proto message of the form (a simplified example) shown below:
When I do the following:
The function throws a
RecursionError. Looks like the nested recursive structure definition throws theschema_forfunction. I am not sure how to fix this - thoughts, @aroch @eldandev? Perhaps, we terminate and return at some depth? Thanks!Please see a snippet of the stacktrace below: