laminlabs / lamindb

A data framework for biology.
https://docs.lamin.ai
Apache License 2.0
129 stars 12 forks source link

Discrepancy in behavior of validate in Curator and low level API for Pandas NAs #2079

Open Zethson opened 1 month ago

Zethson commented 1 month ago

Report

import pandas as pd
import bionty as bt

bt.Disease.validate([pd.NA], field=bt.Disease.name)

gives me

! 0 unique terms (100.00%) are not validated for name: 

as expected. However,

df = pd.DataFrame({"test": [pd.NA]})
curator = ln.Curator.from_df(df, categoricals={"test": bt.Disease.name})
curator.validate()

gives me

✓ test is validated against Disease.name

Version information

No response