Skip to content

Commit

Permalink
move import
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjqliu committed Feb 21, 2025
1 parent a58f099 commit d8ce99c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
manifest_evaluator,
)
from pyiceberg.io import FileIO, load_file_io
from pyiceberg.io.pyarrow import ArrowScan, expression_to_pyarrow, schema_to_pyarrow
from pyiceberg.manifest import (
POSITIONAL_DELETE_SCHEMA,
DataFile,
Expand Down Expand Up @@ -1150,6 +1149,7 @@ def upsert(
Returns:
An UpsertResult class (contains details of rows updated and inserted)
"""
from pyiceberg.io.pyarrow import expression_to_pyarrow
from pyiceberg.table import upsert_util

if join_cols is None:
Expand Down Expand Up @@ -1770,7 +1770,7 @@ def to_arrow_batch_reader(self) -> pa.RecordBatchReader:
"""
import pyarrow as pa

from pyiceberg.io.pyarrow import ArrowScan
from pyiceberg.io.pyarrow import ArrowScan, schema_to_pyarrow

target_schema = schema_to_pyarrow(self.projection())
batches = ArrowScan(
Expand Down Expand Up @@ -1828,6 +1828,8 @@ def to_polars(self) -> pl.DataFrame:
return result

def count(self) -> int:
from pyiceberg.io.pyarrow import ArrowScan

# Usage: Calculates the total number of records in a Scan that haven't had positional deletes.
res = 0
# every task is a FileScanTask
Expand Down

0 comments on commit d8ce99c

Please sign in to comment.