Skip to content

BUG: Fix bugs related to uneven columns and invalid args in trim metadata - #86

Merged
colinvwood merged 1 commit into
qiime2:devfrom
Oddant1:trim-metadata-bugs
Sep 29, 2026
Merged

colinvwood merged 1 commit into
qiime2:devfrom
Oddant1:trim-metadata-bugs

Conversation

@Oddant1

@Oddant1 Oddant1 commented Sep 28, 2026

Copy link
Copy Markdown
Member

Description

When I was calling the cutadapt trim actions from a different plugin, Claude identified the following bugs

  1. Uneven columns cause an error e.g., providing two rows for front_f but only one for front_r causes a NaN to be passed in as a second value for front_r causing an error.

  2. If we are parsing args for trim_single and find paired only args, we drop those args with a warning, but this only occurs if the args have an _ name e.g. front_r. We allow front-r to be used as an arg, so we should warn if it is passed in when invalid.

AI Disclosure

  • NO AI USED.
  • AI USED.

AI Usage Details

Bugs identified and fixed by Claude

@Oddant1 Oddant1 changed the title Fix and test bugs in trim-single/paired found by Claude BUG: Fix bugs related to uneven columns and invalid args in trim metadata Sep 29, 2026
Comment thread q2_cutadapt/_trim.py
Comment on lines +209 to +210
column_adapters = \
metadata.get_column(column).to_series().dropna().tolist()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be better to use the metadata API to drop missing values here. In the rare chance that someone was using a different missing scheme and didn't want those passed on.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I was wrong we would need to have passed encode_missing=True for that to have happened. So is fine as is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be called decode_missing really

@colinvwood colinvwood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise seems good

@colinvwood
colinvwood merged commit ac415ae into qiime2:dev Sep 29, 2026
5 of 6 checks passed
@colinvwood colinvwood removed their assignment Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants