rushilshah1 opened a new issue, #8708:
URL: https://github.com/apache/iceberg/issues/8708

   ### Apache Iceberg version
   
   1.3.1 (latest release)
   
   ### Query engine
   
   Other
   
   ### Please describe the bug 🐞
   
   When using pydantic==2.4.0 I received the below error in the current 
pyiceberg code. It was resolved when reverting back to pydantic 2.3.0
   
   ```
       from pyiceberg.catalog import load_catalog
     File "/opt/bb/lib/python3.11/site-packages/pyiceberg/catalog/__init__.py", 
line 42, in <module>
       from pyiceberg.serializers import ToOutputFile
     File "/opt/bb/lib/python3.11/site-packages/pyiceberg/serializers.py", line 
25, in <module>
       from pyiceberg.table.metadata import TableMetadata, TableMetadataUtil
     File "/opt/bb/lib/python3.11/site-packages/pyiceberg/table/__init__.py", 
line 71, in <module>
       from pyiceberg.table.metadata import INITIAL_SEQUENCE_NUMBER, 
TableMetadata
     File "/opt/bb/lib/python3.11/site-packages/pyiceberg/table/metadata.py", 
line 345, in <module>
       class TableMetadataV2(TableMetadataCommonFields, IcebergBaseModel):
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py",
 line 184, in __new__
       complete_model_class(
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py",
 line 495, in complete_model_class
       schema = apply_discriminators(simplify_schema_references(schema))
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
519, in simplify_schema_references
       schema = walk_core_schema(schema, count_refs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
439, in walk_core_schema
       return f(schema, _dispatch)
              ^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
515, in count_refs
       recurse(state['definitions'][ref], count_refs)
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
362, in handle_model_fields_schema
       replaced_field['schema'] = self.walk(v['schema'], f)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
262, in handle_list_schema
       schema['items_schema'] = self.walk(items_schema, f)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
515, in count_refs
       recurse(state['definitions'][ref], count_refs)
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
362, in handle_model_fields_schema
       replaced_field['schema'] = self.walk(v['schema'], f)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
227, in _handle_other_schemas
       schema['schema'] = self.walk(sub_schema, f)  # type: ignore
                          ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
503, in count_refs
       return recurse(s, count_refs)
              ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
218, in _walk
       schema = self._schema_type_to_method[schema['type']](schema, f)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
289, in handle_tuple_variable_schema
       schema['items_schema'] = self.walk(items_schema, f)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
215, in walk
       return f(schema, self._walk)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/bb/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 
515, in count_refs
       recurse(state['definitions'][ref], count_refs)
               ~~~~~~~~~~~~~~~~~~~~^^^^^
   KeyError: 'pyiceberg.types.NestedField:10303744'
   ```


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to