SaymV commented on code in PR #2859:
URL: https://github.com/apache/iceberg-python/pull/2859#discussion_r2760371706


##########
pyiceberg/types.py:
##########
@@ -124,6 +182,13 @@ def handle_primitive_type(cls, v: Any, handler: 
ValidatorFunctionWrapHandler) ->
         # Pydantic works mostly around dicts, and there seems to be something
         # by not serializing into a RootModel, might revisit this.
         if isinstance(v, str):
+            # When constructing GeometryType/GeographyType directly with 
CRS/algorithm values,
+            # skip the type string parsing to avoid infinite recursion
+            if cls.__name__ == "GeometryType" and not v.startswith("geometry"):

Review Comment:
   I expanded the comment: GeometryType/GeographyType inherit this validator, 
but their root values are raw CRS/algorithm strings. We skip parsing those as 
type strings so pydantic can validate the root values directly instead of 
re-entering the type-parsing logic.



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