|
16 | 16 | # under the License. |
17 | 17 | from __future__ import annotations |
18 | 18 |
|
19 | | -from datetime import datetime |
| 19 | +from datetime import datetime, timezone |
20 | 20 | from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple |
21 | 21 |
|
22 | 22 | from pyiceberg.conversions import from_bytes |
@@ -76,7 +76,7 @@ def snapshots(self) -> "pa.Table": |
76 | 76 | additional_properties = None |
77 | 77 |
|
78 | 78 | snapshots.append({ |
79 | | - "committed_at": datetime.utcfromtimestamp(snapshot.timestamp_ms / 1000.0), |
| 79 | + "committed_at": datetime.fromtimestamp(snapshot.timestamp_ms / 1000.0, tz=timezone.utc), |
80 | 80 | "snapshot_id": snapshot.snapshot_id, |
81 | 81 | "parent_id": snapshot.parent_snapshot_id, |
82 | 82 | "operation": str(operation), |
@@ -465,7 +465,7 @@ def history(self) -> "pa.Table": |
465 | 465 | snapshot = metadata.snapshot_by_id(snapshot_entry.snapshot_id) |
466 | 466 |
|
467 | 467 | history.append({ |
468 | | - "made_current_at": datetime.utcfromtimestamp(snapshot_entry.timestamp_ms / 1000.0), |
| 468 | + "made_current_at": datetime.fromtimestamp(snapshot_entry.timestamp_ms / 1000.0, tz=timezone.utc), |
469 | 469 | "snapshot_id": snapshot_entry.snapshot_id, |
470 | 470 | "parent_id": snapshot.parent_snapshot_id if snapshot else None, |
471 | 471 | "is_current_ancestor": snapshot_entry.snapshot_id in ancestors_ids, |
|
0 commit comments