Skip to content

Commit

Permalink
🎨 Fix
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <[email protected]>
  • Loading branch information
Zethson committed Aug 23, 2024
1 parent 9ebdaaf commit d9726aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lamindb/_can_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,10 @@ def _return(result: list, mapper: dict):
logger.warning(warn_msg)

mapper.update(std_names_bt_mapper)
result = (
pd.Series(std_names_db).cat.rename_categories(std_names_bt_mapper).tolist()
)
if pd.api.types.is_categorical_dtype(std_names_db):
result = std_names_db.cat.rename_categories(std_names_bt_mapper).tolist()

Check warning on line 409 in lamindb/_can_validate.py

View check run for this annotation

Codecov / codecov/patch

lamindb/_can_validate.py#L409

Added line #L409 was not covered by tests
else:
result = pd.Series(std_names_db).replace(std_names_bt_mapper).tolist()
return _return(result=result, mapper=mapper)

else:
Expand Down

0 comments on commit d9726aa

Please sign in to comment.