Skip to content

Commit

Permalink
Sorting dataset versions (#668)
Browse files Browse the repository at this point in the history
* Sorting dataset versions

* fixed test
  • Loading branch information
gsilvestrin authored Mar 8, 2023
1 parent 72701a6 commit 70560f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/python/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_versions(tmp_path: Path):

assert len(lance.dataset(base_dir).versions()) == 2

v2, v1 = lance.dataset(base_dir).versions()
v1, v2 = lance.dataset(base_dir).versions()
assert v1["version"] == 1
assert v2["version"] == 2
assert isinstance(v1["timestamp"], datetime)
Expand Down
1 change: 1 addition & 0 deletions rust/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ impl Dataset {
let manifest = read_manifest(&self.object_store, path).await?;
versions.push(Version::from(&manifest));
}
versions.sort_by_key(|v| v.version);
Ok(versions)
}

Expand Down

0 comments on commit 70560f6

Please sign in to comment.