Skip to content

Commit 4cac691

Browse files
authored
revert avro timestamp-millis mapping (#2223)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change Follow up to #2173, the conversion as implemented is not safe since iceberg does not natively have `millis` precision. Timestamp values are implicitly in `micros` precision This is confirmed by #2173 (comment) Let's revert for now and follow up to figure out the right way to support `millis` precision. # Are these changes tested? # Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent 63a37b1 commit 4cac691

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

pyiceberg/utils/schema_conversion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
LOGICAL_FIELD_TYPE_MAPPING: Dict[Tuple[str, str], PrimitiveType] = {
7070
("date", "int"): DateType(),
7171
("time-micros", "long"): TimeType(),
72-
("timestamp-millis", "int"): TimestampType(),
7372
("timestamp-micros", "long"): TimestampType(),
7473
("uuid", "fixed"): UUIDType(),
7574
("uuid", "string"): UUIDType(),

tests/utils/test_schema_conversion.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,6 @@ def test_convert_uuid_fixed_type() -> None:
341341
assert actual == UUIDType()
342342

343343

344-
def test_convert_timestamp_millis_type() -> None:
345-
avro_logical_type = {"type": "int", "logicalType": "timestamp-millis"}
346-
actual = AvroSchemaConversion()._convert_logical_type(avro_logical_type)
347-
assert actual == TimestampType()
348-
349-
350344
def test_convert_timestamp_micros_type() -> None:
351345
avro_logical_type = {"type": "int", "logicalType": "timestamp-micros"}
352346
actual = AvroSchemaConversion()._convert_logical_type(avro_logical_type)

0 commit comments

Comments
 (0)