ed.io.omop.setup_obs returns an object that ed.io.write_h5ed refuses to write, so the OMOP path has no working round trip.
Two independent causes: datetime64 columns (birth_datetime, observation_period_start_date, observation_period_end_date, plus valid_start_date/valid_end_date in var when enrich_var_with_feature_info=True), which anndata has no HDF5 writer for; and all-null object columns (location_id, provider_id, care_site_id are empty in GiBleed), which h5py rejects with TypeError: Can't implicitly convert non-string objects to strings once the datetimes are cast away.
import duckdb, ehrdata as ed
con = duckdb.connect()
ed.dt.gibleed_omop(backend_handle=con)
edata = ed.io.omop.setup_obs(backend_handle=con, observation_table="person_observation_period")
ed.io.write_h5ed(edata, "mre.h5ed")
# IORegistryError: No method registered for writing
# <class 'pandas.core.arrays.datetimes.DatetimeArray'> into <class 'h5py._hl.group.Group'>
# Error raised while writing key 'birth_datetime' of <class 'h5py._hl.group.Group'> to /obs
ehrdata 0.4.0, anndata 0.13.3.post0, h5py 3.16.0, python 3.14.7.
ed.io.omop.setup_obsreturns an object thated.io.write_h5edrefuses to write, so the OMOP path has no working round trip.Two independent causes: datetime64 columns (
birth_datetime,observation_period_start_date,observation_period_end_date, plusvalid_start_date/valid_end_dateinvarwhenenrich_var_with_feature_info=True), which anndata has no HDF5 writer for; and all-nullobjectcolumns (location_id,provider_id,care_site_idare empty in GiBleed), which h5py rejects withTypeError: Can't implicitly convert non-string objects to stringsonce the datetimes are cast away.ehrdata 0.4.0, anndata 0.13.3.post0, h5py 3.16.0, python 3.14.7.