ome / omero-metadata

OMERO plugin for metadata manipulation https://www.openmicroscopy.org/omero/
GNU General Public License v2.0
7 stars 13 forks source link

Added column type tests #75

Closed muhanadz closed 2 years ago

muhanadz commented 2 years ago

While testing the README changes in https://github.com/ome/omero-metadata/pull/71, written some tests to assert the resolved column types from omero metadata populate.

These tests provide insight and could help us align the expected behavior versus the executed behavior.

will-moore commented 2 years ago

I wonder if, for each of your examples you could test both the auto-detect and the # header detection. You'd need to create a row or two of data (instead of just headers) and create a csv file buffer...

from omero_metadata.cli import MetadataControl
column_types = MetadataControl.detect_headers(csv_buffer)
sbesson commented 2 years ago

My understanding is that both either the pandas based detection or the header row parsing will first a column_types list. This variable is then passed as an argument the HeaderResolver and resolved into OMERO.table columns. The goal of the class introduced in this PR is to add coverage for the last part of the logic.

@will-moore should https://github.com/ome/omero-metadata/pull/75#issuecomment-1129071045 not be a completely separate unit test, possibly re-using the logic of the tests introduced in https://github.com/ome/omero-metadata/pull/72 to test #header -> column_types?

will-moore commented 2 years ago

@sbesson Yes, I guess so. I just seemed that we've already got a good set of column names and corresponding column types in these tests that could be re-used for testing auto-header. But happy for this to happen however it's easiest.