kevinjqliu commented on code in PR #1423: URL: https://github.com/apache/iceberg-python/pull/1423#discussion_r1885380510
########## tests/integration/test_reads.py: ########## @@ -621,6 +621,35 @@ def test_filter_on_new_column(catalog: Catalog) -> None: assert arrow_table["b"].to_pylist() == [None] +@pytest.mark.integration +@pytest.mark.parametrize("catalog", [pytest.lazy_fixture("session_catalog_hive"), pytest.lazy_fixture("session_catalog")]) +def test_filter_case_sensitive(catalog: Catalog) -> None: + test_table_add_column = catalog.load_table("default.test_table_add_column") + arrow_table = test_table_add_column.scan().to_arrow() + assert "2" in arrow_table["b"].to_pylist() + + arrow_table = test_table_add_column.scan(row_filter="b == '2'", case_sensitive=True).to_arrow() + assert arrow_table["b"].to_pylist() == ["2"] + + with pytest.raises(ValueError) as e: + _ = test_table_add_column.scan(row_filter="B == '2'", case_sensitive=True).to_arrow() + assert "Could not find field with name B" in str(e.value) Review Comment: nit: add another test case for for default case sensitive ```suggestion # defaults case sensitive with pytest.raises(ValueError) as e: _ = test_table_add_column.scan(row_filter="B == '2'").to_arrow() assert "Could not find field with name B" in str(e.value) with pytest.raises(ValueError) as e: _ = test_table_add_column.scan(row_filter="B == '2'", case_sensitive=True).to_arrow() assert "Could not find field with name B" in str(e.value) ``` ########## tests/integration/test_deletes.py: ########## @@ -770,3 +789,67 @@ def test_delete_after_partition_evolution_from_partitioned(session_catalog: Rest # Expect 8 records: 10 records - 2 assert len(tbl.scan().to_arrow()) == 8 + + +@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().to_pylist() + + with pytest.raises(ValueError) as e: Review Comment: same for other tests ########## tests/integration/test_deletes.py: ########## @@ -770,3 +789,67 @@ def test_delete_after_partition_evolution_from_partitioned(session_catalog: Rest # Expect 8 records: 10 records - 2 assert len(tbl.scan().to_arrow()) == 8 + + +@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().to_pylist() Review Comment: nit: set ``` expected_value = {"idx": 2, "value": "b"} ``` and reuse the variable ########## tests/integration/test_deletes.py: ########## @@ -770,3 +789,67 @@ def test_delete_after_partition_evolution_from_partitioned(session_catalog: Rest # Expect 8 records: 10 records - 2 assert len(tbl.scan().to_arrow()) == 8 + + +@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().to_pylist() + + with pytest.raises(ValueError) as e: Review Comment: nit: also test default test sensitivity `test_table.delete("Idx == 2")` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org