This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/master by this push:
     new d09e7b8d33 Python: Add integration tests for use_ref (#8534)
d09e7b8d33 is described below

commit d09e7b8d3372cea4660ce806f5614e39b47af926
Author: Amogh Jahagirdar <[email protected]>
AuthorDate: Sat Sep 9 14:49:23 2023 -0700

    Python: Add integration tests for use_ref (#8534)
---
 python/dev/provision.py          | 19 +++++++++++++++++++
 python/tests/test_integration.py | 12 ++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/python/dev/provision.py b/python/dev/provision.py
index 37c5fec973..56e3459edd 100644
--- a/python/dev/provision.py
+++ b/python/dev/provision.py
@@ -134,6 +134,25 @@ VALUES
 """
 )
 
+spark.sql(
+    """
+ALTER TABLE default.test_positional_mor_deletes CREATE TAG tag_12
+    """
+)
+
+spark.sql(
+    """
+ALTER TABLE default.test_positional_mor_deletes CREATE BRANCH without_5
+    """
+)
+
+spark.sql(
+    """
+DELETE FROM default.test_positional_mor_deletes.branch_without_5 WHERE number 
= 5
+    """
+)
+
+
 spark.sql(
     """
 DELETE FROM default.test_positional_mor_deletes WHERE number = 9
diff --git a/python/tests/test_integration.py b/python/tests/test_integration.py
index a63436bdae..297749b1b7 100644
--- a/python/tests/test_integration.py
+++ b/python/tests/test_integration.py
@@ -352,3 +352,15 @@ def test_unpartitioned_fixed_table(catalog: Catalog) -> 
None:
         b"12345678901234567ass12345",
         b"qweeqwwqq1231231231231111",
     ]
+
+
[email protected]
+def test_scan_tag(test_positional_mor_deletes: Table) -> None:
+    arrow_table = 
test_positional_mor_deletes.scan().use_ref("tag_12").to_arrow()
+    assert arrow_table["number"].to_pylist() == [1, 2, 3, 4, 5, 6, 7, 8, 9, 
10, 11, 12]
+
+
[email protected]
+def test_scan_branch(test_positional_mor_deletes: Table) -> None:
+    arrow_table = 
test_positional_mor_deletes.scan().use_ref("without_5").to_arrow()
+    assert arrow_table["number"].to_pylist() == [1, 2, 3, 4, 6, 7, 8, 9, 10, 
11, 12]

Reply via email to