Skip to content

Commit e4ed25e

Browse files
committed
fix if statment
1 parent 312d7e0 commit e4ed25e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

pyiceberg/io/pyarrow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,9 @@ def _read_delete_file(fs: FileSystem, data_file: DataFile) -> Iterator[PositionD
906906
def _read_deletes(fs: FileSystem, data_file: DataFile) -> Dict[str, pa.ChunkedArray]:
907907
deletes_by_file: Dict[str, List[int]] = {}
908908
for delete in _read_delete_file(fs, data_file):
909-
if delete.file_path not in deletes_by_file:
910-
deletes_by_file[delete.file_path] = []
911-
deletes_by_file[delete.file_path].append(delete.pos)
909+
if delete.path not in deletes_by_file:
910+
deletes_by_file[delete.path] = []
911+
deletes_by_file[delete.path].append(delete.pos)
912912

913913
# Convert lists of positions to ChunkedArrays
914914
return {

pyiceberg/manifest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def data_file_with_partition(partition_type: StructType, format_version: TableVe
322322

323323
class PositionDelete(Record):
324324
__slots__ = ("file_path", "pos", "row")
325-
file_path: str
325+
path: str
326326
pos: int
327327
row: Optional[Record]
328328

@@ -332,20 +332,20 @@ def __setattr__(self, name: str, value: Any) -> None:
332332

333333
def __init__(self, file_path: str, pos: int, row: Optional[Record], *data: Any, **named_data: Any) -> None:
334334
super().__init__(*data, **named_data)
335-
self.file_path = file_path
335+
self.path = file_path
336336
self.pos = pos
337337
self.row = row
338338

339339
def __hash__(self) -> int:
340340
"""Return the hash of the file path."""
341-
return hash(self.file_path)
341+
return hash(self.path)
342342

343343
def __eq__(self, other: Any) -> bool:
344344
"""Compare the PositionDelete with another object.
345345
346346
If it is a PositionDelete, it will compare based on the file_path.
347347
"""
348-
return self.file_path == other.file_path if isinstance(other, PositionDelete) else False
348+
return self.path == other.path if isinstance(other, PositionDelete) else False
349349

350350

351351
class DataFile(Record):

pyiceberg/table/inspect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def _generate_positional_delete_table(self, manifest: ManifestFile, schema: Sche
494494
positional_deletes_records = []
495495
for record in positional_delete_file:
496496
row = {
497-
"file_path": record.file_path,
497+
"file_path": record.path,
498498
"pos": record.pos,
499499
"row": record.row,
500500
"partition": entry.data_file.partition.__dict__,
@@ -722,7 +722,7 @@ def position_deletes(self, snapshot_id: Optional[int] = None) -> "pa.Table":
722722
schema = self._get_positional_deletes_schema()
723723
return pa.Table.from_pylist([], schema=schema)
724724

725-
if not snapshot.schema_id:
725+
if snapshot.schema_id == None:
726726
raise ValueError(f"Snapshot {snapshot.snapshot_id} does not have a schema id")
727727

728728
schemas = self.tbl.schemas()

0 commit comments

Comments
 (0)