@@ -521,7 +521,14 @@ def test_tag(tmp_path: Path):
521521 ds .tags .replace_metadata ("tag1" , {"description" : "updated tag" })
522522 ds = lance .dataset (base_dir , "tag1" )
523523 assert ds .version == 1
524- assert ds .tags .list ()["tag1" ]["metadata" ] == {"description" : "updated tag" }
524+ replaced_tag1_meta = ds .tags .list ()["tag1" ]
525+ assert replaced_tag1_meta ["metadata" ] == {"description" : "updated tag" }
526+ assert replaced_tag1_meta ["updated_at" ] == tag1_updated_at
527+
528+ ds .tags .replace_metadata ("tag1" , {"owner" : "ml-team" })
529+ replaced_again_tag1_meta = ds .tags .list ()["tag1" ]
530+ assert replaced_again_tag1_meta ["metadata" ] == {"owner" : "ml-team" }
531+ assert replaced_again_tag1_meta ["updated_at" ] == tag1_updated_at
525532
526533 ds .tags .update ("tag1" , 2 )
527534 updated_tag1_meta = ds .tags .list ()["tag1" ]
@@ -5266,10 +5273,13 @@ def test_branches(tmp_path: Path):
52665273 branch1 .tags .create ("main_latest" , (None , None ))
52675274 branch1 .tags .create ("main_latest2" , ("main" , None ))
52685275 branch1 .create_branch ("branch_from_main" , ("main" , None ))
5276+ ordered_tags = dict (branch1 .tags .list_ordered ())
52695277 branches_with_main = branch1 .branches .list ()
52705278 assert branch1 .tags .list ()["branch1_latest" ]["branch" ] == "branch1"
52715279 assert branch1 .tags .list ()["main_latest" ]["branch" ] is None
52725280 assert branch1 .tags .list ()["main_latest2" ]["branch" ] is None
5281+ assert ordered_tags ["branch1_latest" ]["branch" ] == "branch1"
5282+ assert ordered_tags ["main_latest" ]["branch" ] is None
52735283 assert branches_with_main ["branch_from_main" ]["parent_branch" ] is None
52745284 assert branches_with_main ["branch_from_main" ]["branch_identifier" ][0 ][0 ] == 1
52755285 assert isinstance (
0 commit comments