deeporiginbio / deeporigin-client

Deep Origin CLI and Python client
https://deeporiginbio.github.io/deeporigin-client/
MIT License
9 stars 0 forks source link

Calling get_dataframe on empty database raises TypeError #82

Open bsiranosian opened 1 day ago

bsiranosian commented 1 day ago

Called get_dataframe on an empty database - no rows or columns defined yet. I think this should return empty data or None?

File ~/projects/tesselate/.venv/lib/python3.12/site-packages/deeporigin/data_hub/api.py:866, in get_dataframe(database_id, use_file_names, reference_format, return_type, client)
    862 file_ids = []
    864 # remove notebook columns because they are not
    865 # shown in the UI as columns
--> 866 columns = [
    867     col
    868     for col in columns
    869     if "systemType" not in col.keys() or col["systemType"] != "bodyDocument"
    870 ]
    872 # create empty lists for each column
    873 for column in columns:

TypeError: 'NoneType' object is not iterable
sg-s commented 1 day ago

good catch! we should probably return None

sg-s commented 1 day ago

also fixed in https://github.com/deeporiginbio/deeporigin-client/pull/81