This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-4381-d064b320954b31163eef3ff3a34a6e8f20ab75ae in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
commit 108ce0f8a51292a3519b2a41f2ec5d4359b415a1 Author: chenjian2664 <[email protected]> AuthorDate: Wed Nov 18 10:03:22 2026 +0000 Remove leftover name-mapping bookkeeping from _ConvertToIceberg (#4381) Name mapping moved out of this visitor into apply_name_mapping in #1014, but the docstring still claims it applies name-mapping IDs, and list() and map() still push and pop field names around the _field_id calls, which no longer read them. --- pyiceberg/io/pyarrow.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pyiceberg/io/pyarrow.py b/pyiceberg/io/pyarrow.py index 5961da883..96d6da73e 100644 --- a/pyiceberg/io/pyarrow.py +++ b/pyiceberg/io/pyarrow.py @@ -1465,7 +1465,7 @@ class _HasIds(PyArrowSchemaVisitor[bool]): class _ConvertToIceberg(PyArrowSchemaVisitor[IcebergType | Schema]): - """Converts PyArrowSchema to Iceberg Schema. Applies the IDs from name_mapping if provided.""" + """Converts PyArrowSchema to Iceberg Schema.""" _field_names: builtins.list[str] @@ -1496,20 +1496,14 @@ class _ConvertToIceberg(PyArrowSchemaVisitor[IcebergType | Schema]): def list(self, list_type: pa.ListType, element_result: IcebergType) -> ListType: element_field = list_type.value_field - self._field_names.append(LIST_ELEMENT_NAME) element_id = self._field_id(element_field) - self._field_names.pop() return ListType(element_id, element_result, element_required=not element_field.nullable) def map(self, map_type: pa.MapType, key_result: IcebergType, value_result: IcebergType) -> MapType: key_field = map_type.key_field - self._field_names.append(MAP_KEY_NAME) key_id = self._field_id(key_field) - self._field_names.pop() value_field = map_type.item_field - self._field_names.append(MAP_VALUE_NAME) value_id = self._field_id(value_field) - self._field_names.pop() return MapType(key_id, key_result, value_id, value_result, value_required=not value_field.nullable) def primitive(self, primitive: pa.DataType) -> PrimitiveType:
