Skip to content

Commit 698ce85

Browse files
committed
Make CI happy
1 parent da4c784 commit 698ce85

5 files changed

Lines changed: 22 additions & 31 deletions

File tree

tests/conftest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,7 +2788,7 @@ def pyarrow_schema_with_promoted_types() -> "pa.Schema":
27882788
pa.field("list", pa.list_(pa.int32()), nullable=False), # can support upcasting integer to long
27892789
pa.field("map", pa.map_(pa.string(), pa.int32()), nullable=False), # can support upcasting integer to long
27902790
pa.field("double", pa.float32(), nullable=True), # can support upcasting float to double
2791-
pa.field("uuid", pa.binary(length=16), nullable=True), # can support upcasting float to double
2791+
pa.field("uuid", pa.binary(length=16), nullable=True), # can support upcasting fixed to uuid
27922792
)
27932793
)
27942794

@@ -2804,7 +2804,10 @@ def pyarrow_table_with_promoted_types(pyarrow_schema_with_promoted_types: "pa.Sc
28042804
"list": [[1, 1], [2, 2]],
28052805
"map": [{"a": 1}, {"b": 2}],
28062806
"double": [1.1, 9.2],
2807-
"uuid": [b"qZx\xefNS@\x89\x9b\xf9:\xd0\xee\x9b\xf5E", b"\x97]\x87T^JDJ\x96\x97\xf4v\xe4\x03\x0c\xde"],
2807+
"uuid": [
2808+
uuid.UUID("00000000-0000-0000-0000-000000000000").bytes,
2809+
uuid.UUID("11111111-1111-1111-1111-111111111111").bytes,
2810+
],
28082811
},
28092812
schema=pyarrow_schema_with_promoted_types,
28102813
)

tests/integration/test_add_files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ def test_add_files_with_valid_upcast(
737737
with pq.ParquetWriter(fos, schema=pyarrow_schema_with_promoted_types) as writer:
738738
writer.write_table(pyarrow_table_with_promoted_types)
739739

740-
tbl.add_files(file_paths=[file_path])
740+
tbl.add_files(file_paths=[file_path], check_duplicate_files=False)
741741
# table's long field should cast to long on read
742742
written_arrow_table = tbl.scan().to_arrow()
743743
assert written_arrow_table == pyarrow_table_with_promoted_types.cast(
@@ -747,7 +747,7 @@ def test_add_files_with_valid_upcast(
747747
pa.field("list", pa.list_(pa.int64()), nullable=False),
748748
pa.field("map", pa.map_(pa.string(), pa.int64()), nullable=False),
749749
pa.field("double", pa.float64(), nullable=True),
750-
pa.field("uuid", pa.binary(length=16), nullable=True), # can UUID is read as fixed length binary of length 16
750+
pa.field("uuid", pa.uuid(), nullable=True),
751751
)
752752
)
753753
)

tests/integration/test_partitioning_key.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
# pylint:disable=redefined-outer-name
18-
import uuid
1918
from datetime import date, datetime, timedelta, timezone
2019
from decimal import Decimal
2120
from typing import Any, List
@@ -308,25 +307,6 @@
308307
(CAST('2023-01-01' AS DATE), 'Associated string value for date 2023-01-01')
309308
""",
310309
),
311-
(
312-
[PartitionField(source_id=14, field_id=1001, transform=IdentityTransform(), name="uuid_field")],
313-
[uuid.UUID("f47ac10b-58cc-4372-a567-0e02b2c3d479")],
314-
Record("f47ac10b-58cc-4372-a567-0e02b2c3d479"),
315-
"uuid_field=f47ac10b-58cc-4372-a567-0e02b2c3d479",
316-
f"""CREATE TABLE {identifier} (
317-
uuid_field string,
318-
string_field string
319-
)
320-
USING iceberg
321-
PARTITIONED BY (
322-
identity(uuid_field)
323-
)
324-
""",
325-
f"""INSERT INTO {identifier}
326-
VALUES
327-
('f47ac10b-58cc-4372-a567-0e02b2c3d479', 'Associated string value for UUID f47ac10b-58cc-4372-a567-0e02b2c3d479')
328-
""",
329-
),
330310
(
331311
[PartitionField(source_id=11, field_id=1001, transform=IdentityTransform(), name="binary_field")],
332312
[b"example"],

tests/integration/test_reads.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,15 @@ def test_partitioned_tables(catalog: Catalog) -> None:
588588
def test_unpartitioned_uuid_table(catalog: Catalog) -> None:
589589
unpartitioned_uuid = catalog.load_table("default.test_uuid_and_fixed_unpartitioned")
590590
arrow_table_eq = unpartitioned_uuid.scan(row_filter="uuid_col == '102cb62f-e6f8-4eb0-9973-d9b012ff0967'").to_arrow()
591-
assert arrow_table_eq["uuid_col"].to_pylist() == [uuid.UUID("102cb62f-e6f8-4eb0-9973-d9b012ff0967").bytes]
591+
assert arrow_table_eq["uuid_col"].to_pylist() == [uuid.UUID("102cb62f-e6f8-4eb0-9973-d9b012ff0967")]
592592

593593
arrow_table_neq = unpartitioned_uuid.scan(
594594
row_filter="uuid_col != '102cb62f-e6f8-4eb0-9973-d9b012ff0967' and uuid_col != '639cccce-c9d2-494a-a78c-278ab234f024'"
595595
).to_arrow()
596596
assert arrow_table_neq["uuid_col"].to_pylist() == [
597-
uuid.UUID("ec33e4b2-a834-4cc3-8c4a-a1d3bfc2f226").bytes,
598-
uuid.UUID("c1b0d8e0-0b0e-4b1e-9b0a-0e0b0d0c0a0b").bytes,
599-
uuid.UUID("923dae77-83d6-47cd-b4b0-d383e64ee57e").bytes,
597+
uuid.UUID("ec33e4b2-a834-4cc3-8c4a-a1d3bfc2f226"),
598+
uuid.UUID("c1b0d8e0-0b0e-4b1e-9b0a-0e0b0d0c0a0b"),
599+
uuid.UUID("923dae77-83d6-47cd-b4b0-d383e64ee57e"),
600600
]
601601

602602

tests/integration/test_writes/test_writes.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from pyiceberg.schema import Schema
5151
from pyiceberg.table import TableProperties
5252
from pyiceberg.table.sorting import SortDirection, SortField, SortOrder
53-
from pyiceberg.transforms import BucketTransform, DayTransform, HourTransform, IdentityTransform, Transform
53+
from pyiceberg.transforms import DayTransform, HourTransform, IdentityTransform, Transform
5454
from pyiceberg.types import (
5555
DateType,
5656
DecimalType,
@@ -1274,7 +1274,7 @@ def test_table_write_schema_with_valid_upcast(
12741274
pa.field("list", pa.list_(pa.int64()), nullable=False),
12751275
pa.field("map", pa.map_(pa.string(), pa.int64()), nullable=False),
12761276
pa.field("double", pa.float64(), nullable=True), # can support upcasting float to double
1277-
pa.field("uuid", pa.binary(length=16), nullable=True), # can UUID is read as fixed length binary of length 16
1277+
pa.field("uuid", pa.uuid(), nullable=True),
12781278
)
12791279
)
12801280
)
@@ -1847,7 +1847,15 @@ def test_read_write_decimals(session_catalog: Catalog) -> None:
18471847

18481848

18491849
@pytest.mark.integration
1850-
@pytest.mark.parametrize("transform", [IdentityTransform(), BucketTransform(32)])
1850+
@pytest.mark.parametrize(
1851+
"transform",
1852+
[
1853+
IdentityTransform(),
1854+
# Bucket is disabled because of an issue in Iceberg Java:
1855+
# https://github.com/apache/iceberg/pull/13324
1856+
# BucketTransform(32)
1857+
],
1858+
)
18511859
def test_uuid_partitioning(session_catalog: Catalog, spark: SparkSession, transform: Transform) -> None: # type: ignore
18521860
identifier = f"default.test_uuid_partitioning_{str(transform).replace('[32]', '')}"
18531861

0 commit comments

Comments
 (0)