This is an automated email from the ASF dual-hosted git repository.
honahx pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
The following commit(s) were added to refs/heads/main by this push:
new a4856bc Small simplification in the name-mapping (#351)
a4856bc is described below
commit a4856bc2eadf90ac85dec96d4502ca3517bb1bb5
Author: Fokko Driesprong <[email protected]>
AuthorDate: Fri Feb 2 03:02:56 2024 +0100
Small simplification in the name-mapping (#351)
---
pyiceberg/io/pyarrow.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/pyiceberg/io/pyarrow.py b/pyiceberg/io/pyarrow.py
index 38d7d4a..3e056b1 100644
--- a/pyiceberg/io/pyarrow.py
+++ b/pyiceberg/io/pyarrow.py
@@ -811,12 +811,9 @@ class
_ConvertToIceberg(PyArrowSchemaVisitor[Union[IcebergType, Schema]]):
self._field_names = []
self._name_mapping = name_mapping
- def _current_path(self) -> str:
- return ".".join(self._field_names)
-
def _field_id(self, field: pa.Field) -> int:
if self._name_mapping:
- return self._name_mapping.find(self._current_path()).field_id
+ return self._name_mapping.find(*self._field_names).field_id
elif (field_id := _get_field_id(field)) is not None:
return field_id
else: