Skip to content

Commit

Permalink
🐛 Fix label name display in .describe() (laminlabs#2006)
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf authored Oct 1, 2024
1 parent 03cde90 commit 37f34c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lamindb/core/_label_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ def print_labels(
# there is a try except block here to deal with schema inconsistencies
# during transfer between instances
try:
field = get_name_field(self.__class__)
field = get_name_field(labels)
labels_list = list(labels.values_list(field, flat=True))
if len(labels_list) > 0:
get_name_field(labels)
print_values = _print_values(labels_list, n=10)
type_str = f": {related_model}" if print_types else ""
labels_msg += f" .{related_name}{type_str} = {print_values}\n"
Expand Down
1 change: 1 addition & 0 deletions tests/core/test_feature_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_features_add(adata):
artifact.ulabels.add(experiment_label)
assert artifact.links_ulabel.get().ulabel.name == "Experiment 1"
assert artifact.links_ulabel.get().feature is None
assert artifact.labels.__repr__().endswith(" .ulabels = 'Experiment 1'\n")

# now add the label with the feature and make sure that it has the feature annotation
artifact.features.add_values({"experiment": "Experiment 1"})
Expand Down

0 comments on commit 37f34c1

Please sign in to comment.