qiime2 / q2-metadata

BSD 3-Clause "New" or "Revised" License
3 stars 17 forks source link

BUG: better error handling for differing index names when running `merge` #63

Closed lizgehret closed 7 months ago

lizgehret commented 12 months ago

Bug Description When running merge on two different metadata files with different index names (i.e. sample-id and ID), the following error message is produced:

Screen Shot 2023-12-05 at 2 32 25 PM

This provides little to no clarification regarding the issue being different index names (vs. the index name being set to None).

Steps to reproduce the behavior

  1. Go to the Moving Pictures tutorial and download sample-metadata.tsv

  2. Duplicate the sample-metadata.tsv file and save it as two different files (e.g. sample-md1.tsv & sample-md2.tsv)

  3. Within one of the duplicated files, modify the index name (e.g. ID)

  4. Run the following command:

    qiime metadata merge \
    --m-metadata1-file sample-md1.tsv \
    --m-metadata2-file sample-md2.tsv \
    --o-merged-metadata merged-md.qza \
    --verbose

This will produce the error in the screenshot above.

Expected behavior A new error should be raised that will check for matching index names within the two metadata files, so that the error above is handled with a message that is more informative to the user. Additionally, the help text for this method should include one or two sentences regarding index names needing to match.

lizgehret commented 12 months ago

Last one for now @hagenjp - these should all keep you busy for a while 🙂