Skip to content

Commit

Permalink
Small simplification in the name-mapping (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko authored Feb 2, 2024
1 parent a983935 commit a4856bc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pyiceberg/io/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,9 @@ def __init__(self, name_mapping: Optional[NameMapping] = None) -> None:
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:
Expand Down

0 comments on commit a4856bc

Please sign in to comment.