Skip to content

IMP: recognize type-mapped Bool variables as Bool variables - #401

Merged
ebolyen merged 3 commits into
rachis-org:devfrom
colinvwood:recognize-typemapped-bool
Jul 17, 2026
Merged

ebolyen merged 3 commits into
rachis-org:devfrom
colinvwood:recognize-typemapped-bool

Conversation

@colinvwood

Copy link
Copy Markdown
Contributor

Description

Fixes an issue where type-mapped Bool variables were not recognized as Bools and rendering on the cli fell back to the standard --p-param VALUE format.

AI Disclosure

  • NO AI USED.
  • AI USED.

AI Usage Details

Generated by Codex while working on qiime2/q2-dada2#190

@colinvwood

colinvwood commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Needed by qiime2/q2-dada2#190

@colinvwood colinvwood mentioned this pull request Jun 15, 2026
1 of 2 tasks
@colinvwood colinvwood self-assigned this Jun 15, 2026
@ebolyen ebolyen assigned ebolyen and unassigned colinvwood Jun 16, 2026

@ebolyen ebolyen 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.

I don't think you actually need this PR for what you wanted to do, but I have no objection to making it so that TypeVar where all branches are Bool is treated the same as Bool % TypeVar.

Comment thread q2cli/core/state.py Outdated
Comment thread q2cli/core/state.py Outdated
Comment thread q2cli/core/state.py Outdated
@ebolyen ebolyen assigned colinvwood and unassigned ebolyen Jun 17, 2026
@colinvwood

Copy link
Copy Markdown
Contributor Author

What's your preference re keeping this? Indeed your changes in q2-dada2 got me to the same place.

@ebolyen

ebolyen commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

I think there's no harm in making this work. I guess the only difficulty is testing and if it's worth adding another action to dummy_plugin for it.

I'm also fine with putting it on the back-burner. There are perhaps other ways to handle this directly, such as distributing the TypeVar branches over the predicate so that it just always normalizes. Although it may be tricky to ensure that it still looks correct at different call-sites.

@colinvwood colinvwood assigned ebolyen and unassigned colinvwood Jun 30, 2026

@ebolyen ebolyen 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.

Thanks @colinvwood!

Comment thread q2cli/tests/test_cli.py

def test_higher_union_bool_typemap_parameter_is_flag(self):
plugin = _register_higher_union_bool_flag_action()
command = PluginCommand(get_plugin_state(plugin), 'dummy-plugin')

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.

Well that looks pretty good to me actually. I wonder if we could transition more tests this way? Then q2cli isn't so coupled to a test plugin in another package.

@ebolyen
ebolyen merged commit d222ce3 into rachis-org:dev Jul 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants