Skip to content

Commit 33a99fb

Browse files
kevinjqliuCopilot
andcommitted
Use a loop instead of parametrize in timestamp-nanos conversion test
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent df016ca commit 33a99fb

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

‎tests/utils/test_schema_conversion.py‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
DateType,
2727
DecimalType,
2828
FixedType,
29-
IcebergType,
3029
IntegerType,
3130
ListType,
3231
LongType,
@@ -350,20 +349,17 @@ def test_convert_timestamp_micros_type() -> None:
350349
assert actual == TimestampType()
351350

352351

353-
@pytest.mark.parametrize(
354-
"adjust_to_utc, expected",
355-
[
352+
def test_convert_timestamp_nanos_type() -> None:
353+
for adjust_to_utc, expected in [
356354
(None, TimestampNanoType()),
357355
(False, TimestampNanoType()),
358356
(True, TimestamptzNanoType()),
359-
],
360-
)
361-
def test_convert_timestamp_nanos_type(adjust_to_utc: bool | None, expected: IcebergType) -> None:
362-
avro_logical_type: dict[str, Any] = {"type": "long", "logicalType": "timestamp-nanos"}
363-
if adjust_to_utc is not None:
364-
avro_logical_type["adjust-to-utc"] = adjust_to_utc
365-
actual = AvroSchemaConversion()._convert_logical_type(avro_logical_type)
366-
assert actual == expected
357+
]:
358+
avro_logical_type: dict[str, Any] = {"type": "long", "logicalType": "timestamp-nanos"}
359+
if adjust_to_utc is not None:
360+
avro_logical_type["adjust-to-utc"] = adjust_to_utc
361+
actual = AvroSchemaConversion()._convert_logical_type(avro_logical_type)
362+
assert actual == expected, f"adjust-to-utc={adjust_to_utc}"
367363

368364

369365
def test_timestamp_nanos_avro_schema_round_trip() -> None:

0 commit comments

Comments
 (0)