Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jiakai-li committed Dec 14, 2024
1 parent 111adfb commit 80a7c68
Showing 1 changed file with 7 additions and 24 deletions.
31 changes: 7 additions & 24 deletions tests/integration/test_deletes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
# pylint:disable=redefined-outer-name
from datetime import datetime
from typing import List
from typing import Generator, List

import pyarrow as pa
import pytest
Expand All @@ -31,7 +31,7 @@
from pyiceberg.table import Table
from pyiceberg.table.snapshots import Operation, Summary
from pyiceberg.transforms import IdentityTransform
from pyiceberg.types import FloatType, IntegerType, LongType, NestedField, TimestampType, StringType
from pyiceberg.types import FloatType, IntegerType, LongType, NestedField, StringType, TimestampType


def run_spark_commands(spark: SparkSession, sqls: List[str]) -> None:
Expand All @@ -40,38 +40,21 @@ def run_spark_commands(spark: SparkSession, sqls: List[str]) -> None:


@pytest.fixture()
def test_table(session_catalog: RestCatalog) -> Table:
def test_table(session_catalog: RestCatalog) -> Generator[Table, None, None]:
identifier = "default.__test_table"

arrow_table = pa.Table.from_arrays(
[
pa.array([1, 2, 3, 4, 5]),
pa.array(["a", "b", "c", "d", "e"])
],
names=["idx", "value"]
)

try:
session_catalog.drop_table(identifier)
except NoSuchTableError:
pass

arrow_table = pa.Table.from_arrays([pa.array([1, 2, 3, 4, 5]), pa.array(["a", "b", "c", "d", "e"])], names=["idx", "value"])
test_table = session_catalog.create_table(
identifier,
schema=Schema(
NestedField(1, "idx", LongType()),
NestedField(2, "value", StringType()),
)
),
)

test_table.append(arrow_table)

yield test_table

try:
session_catalog.drop_table(identifier)
except NoSuchTableError:
pass
session_catalog.drop_table(identifier)


@pytest.mark.integration
Expand Down Expand Up @@ -810,7 +793,7 @@ def test_delete_after_partition_evolution_from_partitioned(session_catalog: Rest

@pytest.mark.integration
def test_delete_with_filter_case_sensitive(test_table: Table) -> None:
assert {"idx": 2, "value": "b"} in test_table.scan().to_arrow()["idx"].to_pylist()
assert {"idx": 2, "value": "b"} in test_table.scan().to_arrow().to_pylist()

with pytest.raises(ValueError) as e:
test_table.delete("Idx == 2", case_sensitive=True)
Expand Down

0 comments on commit 80a7c68

Please sign in to comment.