rdblue commented on code in PR #6525:
URL: https://github.com/apache/iceberg/pull/6525#discussion_r1064184978


##########
python/pyiceberg/utils/iceberg_base_model.py:
##########
@@ -60,3 +63,39 @@ def json(self, exclude_none: bool = True, exclude: 
Optional[Set[str]] = None, by
         return super().json(
             exclude_none=exclude_none, 
exclude=self._exclude_private_properties(exclude), by_alias=by_alias, **kwargs
         )
+
+
+class PydanticStruct(IcebergBaseModel):
+    class Config:
+        frozen = False
+
+    def __setitem__(self, pos: int, value: Any) -> None:
+        positions = list(self.__fields__.values())
+        self.__setattr__(positions[pos].name, value)
+
+    def __getitem__(self, pos: int) -> Any:
+        positions = list(self.__fields__.values())
+        return self.__getattribute__(positions[pos].name)
+
+
+class Record(PydanticStruct):

Review Comment:
   What is the value of using Pydantic for this class? Aren't we overriding 
everything?



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