Skip to content

Commit

Permalink
Merge branch 'main' of github.com:apache/iceberg-python into fd-renam…
Browse files Browse the repository at this point in the history
…e-conf
  • Loading branch information
Fokko committed Aug 6, 2024
2 parents 92b5d1e + bfe9991 commit 7175490
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ github:
projects: true
collaborators: # Note: the number of collaborators is limited to 10
- ajantha-bhat
- syun64
- kevinjqliu
- ndrluis
ghp_branch: gh-pages
ghp_path: /

Expand Down
10 changes: 10 additions & 0 deletions dev/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,13 @@
VALUES (4)
"""
)

spark.sql(
f"""
CREATE OR REPLACE TABLE {catalog_name}.default.test_empty_scan_ordered_str (id string NOT NULL)
USING iceberg
TBLPROPERTIES ('format-version'='2')
"""
)
spark.sql(f"ALTER TABLE {catalog_name}.default.test_empty_scan_ordered_str WRITE ORDERED BY id")
spark.sql(f"INSERT INTO {catalog_name}.default.test_empty_scan_ordered_str VALUES 'a', 'c'")
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyiceberg/io/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ def schema_partner(self, partner: Optional[pa.Array]) -> Optional[pa.Array]:
return partner

def field_partner(self, partner_struct: Optional[pa.Array], field_id: int, _: str) -> Optional[pa.Array]:
if partner_struct:
if partner_struct is not None:
# use the field name from the file schema
try:
name = self.file_schema.find_field(field_id).name
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/test_reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,3 +663,11 @@ def another_task() -> None:

table.transaction().set_properties(lock="xxx").commit_transaction()
assert table.properties.get("lock") == "xxx"


@pytest.mark.integration
@pytest.mark.parametrize("catalog", [pytest.lazy_fixture("session_catalog_hive"), pytest.lazy_fixture("session_catalog")])
def test_empty_scan_ordered_str(catalog: Catalog) -> None:
table_empty_scan_ordered_str = catalog.load_table("default.test_empty_scan_ordered_str")
arrow_table = table_empty_scan_ordered_str.scan(EqualTo("id", "b")).to_arrow()
assert len(arrow_table) == 0

0 comments on commit 7175490

Please sign in to comment.