Skip to content

Commit

Permalink
Replace all remaining of project_table using ArrowScan.to_table
Browse files Browse the repository at this point in the history
Replace all remaining of project_table using ArrowScan.to_table
  • Loading branch information
JE-Chen committed Sep 17, 2024
1 parent b64c5d9 commit 10c7b5e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/io/test_pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
bin_pack_arrow_table,
expression_to_pyarrow,
ArrowScan,
project_table,
schema_to_pyarrow,
)
from pyiceberg.manifest import DataFile, DataFileContent, FileFormat
Expand Down Expand Up @@ -1413,9 +1412,7 @@ def test_delete(deletes_file: str, example_task: FileScanTask, table_schema_simp
data_file=example_task.file,
delete_files={DataFile(content=DataFileContent.POSITION_DELETES, file_path=deletes_file, file_format=FileFormat.PARQUET)},
)

with_deletes = project_table(
tasks=[example_task_with_delete],
with_deletes = ArrowScan(
table_metadata=TableMetadataV2(
location=metadata_location,
last_column_id=1,
Expand All @@ -1425,8 +1422,10 @@ def test_delete(deletes_file: str, example_task: FileScanTask, table_schema_simp
partition_specs=[PartitionSpec()],
),
io=load_file_io(),
row_filter=AlwaysTrue(),
projected_schema=table_schema_simple,
row_filter=AlwaysTrue(),
).to_table(
tasks=[example_task_with_delete]
)

assert (
Expand All @@ -1452,8 +1451,7 @@ def test_delete_duplicates(deletes_file: str, example_task: FileScanTask, table_
},
)

with_deletes = project_table(
tasks=[example_task_with_delete],
with_deletes = ArrowScan(
table_metadata=TableMetadataV2(
location=metadata_location,
last_column_id=1,
Expand All @@ -1463,8 +1461,10 @@ def test_delete_duplicates(deletes_file: str, example_task: FileScanTask, table_
partition_specs=[PartitionSpec()],
),
io=load_file_io(),
row_filter=AlwaysTrue(),
projected_schema=table_schema_simple,
row_filter=AlwaysTrue(),
).to_table(
tasks=[example_task_with_delete]
)

assert (
Expand All @@ -1482,8 +1482,8 @@ def test_delete_duplicates(deletes_file: str, example_task: FileScanTask, table_

def test_pyarrow_wrap_fsspec(example_task: FileScanTask, table_schema_simple: Schema) -> None:
metadata_location = "file://a/b/c.json"
projection = project_table(
tasks=[example_task],

projection = ArrowScan(
table_metadata=TableMetadataV2(
location=metadata_location,
last_column_id=1,
Expand All @@ -1496,6 +1496,8 @@ def test_pyarrow_wrap_fsspec(example_task: FileScanTask, table_schema_simple: Sc
case_sensitive=True,
projected_schema=table_schema_simple,
row_filter=AlwaysTrue(),
).to_table(
tasks=[example_task]
)

assert (
Expand Down

0 comments on commit 10c7b5e

Please sign in to comment.