Skip to content

Commit 6619662

Browse files
committed
test: remove e2e polars test from unit tests to fix windows module isolation
1 parent 363fb99 commit 6619662

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

‎tests/table/test_init.py‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import json
1919
import uuid
2020
from copy import copy
21-
from pathlib import Path
2221
from typing import Any
2322

2423
import pytest
@@ -2063,40 +2062,3 @@ def mock_scan_iceberg(source: Any, **kwargs: Any) -> Any:
20632062
table_v2,
20642063
{"storage_options": storage_options, "snapshot_id": 12345, "reader_override": "native"},
20652064
)
2066-
2067-
2068-
def test_table_to_polars_e2e(tmp_path: Path) -> None:
2069-
import pyarrow as pa
2070-
2071-
from pyiceberg.catalog.sql import SqlCatalog
2072-
from pyiceberg.schema import Schema
2073-
from pyiceberg.types import IntegerType, NestedField, StringType
2074-
2075-
catalog = SqlCatalog("test_sql", uri=f"sqlite:///{tmp_path}/test.db", warehouse=f"file://{tmp_path}")
2076-
catalog.create_namespace("default")
2077-
schema = Schema(
2078-
NestedField(1, "id", IntegerType(), required=True),
2079-
NestedField(2, "name", StringType(), required=True),
2080-
)
2081-
table = catalog.create_table("default.test_polars", schema=schema)
2082-
arrow_table = pa.Table.from_pylist(
2083-
[{"id": 1, "name": "alice"}, {"id": 2, "name": "bob"}],
2084-
schema=schema.as_arrow(),
2085-
)
2086-
table.append(arrow_table)
2087-
2088-
# 1. E2E without kwargs
2089-
lf = table.to_polars()
2090-
df = lf.collect()
2091-
assert df.shape == (2, 2)
2092-
assert df["id"].to_list() == [1, 2]
2093-
assert df["name"].to_list() == ["alice", "bob"]
2094-
2095-
# 2. E2E with real kwargs (snapshot_id)
2096-
current_snap = table.current_snapshot()
2097-
assert current_snap is not None
2098-
lf_snap = table.to_polars(snapshot_id=current_snap.snapshot_id)
2099-
df_snap = lf_snap.collect()
2100-
assert df_snap.shape == (2, 2)
2101-
assert df_snap["id"].to_list() == [1, 2]
2102-
assert df_snap["name"].to_list() == ["alice", "bob"]

0 commit comments

Comments
 (0)