From d8ce99ccf36746fb6972a9ec9a20500b3bd9de81 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Fri, 21 Feb 2025 12:51:27 -0800 Subject: [PATCH] move import --- pyiceberg/table/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyiceberg/table/__init__.py b/pyiceberg/table/__init__.py index 04ac18baf3..5e96e6a225 100644 --- a/pyiceberg/table/__init__.py +++ b/pyiceberg/table/__init__.py @@ -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, @@ -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: @@ -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( @@ -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