From cda6a834f1671b71cdf898027a802574b0c8aac6 Mon Sep 17 00:00:00 2001 From: Zhou Fang Date: Tue, 16 Jan 2024 20:16:03 -0800 Subject: [PATCH] Sort snapshot by create time in versions() result (#65) --- python/src/space/core/storage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/src/space/core/storage.py b/python/src/space/core/storage.py index a4c6666..1530fe7 100644 --- a/python/src/space/core/storage.py +++ b/python/src/space/core/storage.py @@ -359,9 +359,10 @@ def versions(self) -> pa.Table: ("tag_or_branch", pa.string()) # type: ignore[list-item] ])) + sort_args = [("create_time", "descending")] return snapshot_id_table.join(ref_table, keys=["snapshot_id"], - join_type="left outer") + join_type="left outer").sort_by(sort_args) def ray_dataset(self, read_options: ReadOptions) -> ray.Dataset: """Return a Ray dataset for a Space storage."""