qiime2 / q2-metadata

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

BUG: `merge` doesn't list the offending filename when erroring on file contents #62

Closed lizgehret closed 4 months ago

lizgehret commented 9 months ago

Bug Description When running merge on two different metadata files, if one file contains a formatting issue (i.e. CategoricalMetadataColumn contains floats), the name of the offending file is not listed in the error message. See screenshot below:

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

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. Modify the month column's comment directive in one of the duplicated files to categorical and change the dtype of this column to float.
  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, giving no indication of whether the offending file is sample-md1.tsv or sample-md2.tsv.

Expected behavior The error message above should begin with something like:

There was an issue with loading the file sample-md1.tsv ...etc
lizgehret commented 9 months ago

Another one for you to work on when you're ready @hagenjp 🙂