Skip to content

Conversation

Copy link

Copilot AI commented Jan 12, 2026

Implementation Plan: Replace visible_choices with hidden_choices

  • Update parameter.py EnumParameter class:
    • Rename visible_choices parameter to hidden_choices
    • Invert the logic: filter out hidden items instead of showing only visible ones
    • Update docstring to explain new semantics (None = hide nothing/show all)
    • Rename internal methods and variables for consistency
  • Update test_knime_parameter.py:
    • Update test class names and methods
    • Invert filter functions to return hidden items instead of visible
    • Update test assertions to match new behavior
    • Ensure all edge cases still work (empty, invalid, caching)
    • Add test for hiding all options
  • Run Python tests to validate changes - All 87 tests pass
  • Address docstring format issues from bot reviewer
    • Add Returns section to _generate_options_description
    • Add Returns section to _generate_description
  • Address code review feedback on docstring formatting
  • Address review comments from @chaubold:
    • Rename validated_hidden to validated_members for consistency
    • Clarify test comment about valid vs invalid members

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 12, 2026 14:20
Co-authored-by: AtR1an <12174376+AtR1an@users.noreply.github.com>
Co-authored-by: AtR1an <12174376+AtR1an@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • pixi.sh
    • Triggering command: /usr/bin/curl curl -fsSL REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add visible_choices for EnumParameter AP-25288: Replace visible_choices with hidden_choices for EnumParameter Jan 12, 2026
Copilot AI requested a review from AtR1an January 12, 2026 14:22
self.assertIn("Valid options", warning_msg)

# Schema should only contain valid member
# Schema should hide only the valid member (LINEAR)
Copy link
Contributor

Choose a reason for hiding this comment

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

the invalid member LINEAR?

Copy link
Author

Choose a reason for hiding this comment

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

Clarified in da43ba1. LINEAR is a valid enum member that's being hidden (the only valid member in the list that also contains invalid members). The test verifies that invalid members are filtered out with a warning, while valid members like LINEAR are properly hidden.


# Validate that all returned members exist in the enum
valid_names = set(self._enum._member_names_)
validated_members = []
Copy link
Contributor

Choose a reason for hiding this comment

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

this should probably still be validated_members instead of validated_hidden and invalid_members

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in da43ba1. Renamed validated_hidden to validated_members for consistency with the codebase pattern.

-------
str
A formatted description string containing the available options,
optionally restricted to the provided ``visible_options``.
Copy link
Contributor

Choose a reason for hiding this comment

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

visible_options should also be turned to hidden_options, right?

Copy link
Author

Choose a reason for hiding this comment

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

The parameter name visible_options is semantically correct here. It contains the list of options that are visible (i.e., NOT hidden) after filtering. The method uses this list to generate a description showing those visible options. Renaming it to hidden_options would be misleading since it doesn't contain hidden options.

@AtR1an
Copy link
Contributor

AtR1an commented Jan 12, 2026

@copilot can you address the comments left by @chaubold? On this branch please

Co-authored-by: AtR1an <12174376+AtR1an@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 12, 2026

@copilot can you address the comments left by @chaubold? On this branch please

Addressed @chaubold's comments in da43ba1. Fixed variable naming and clarified test comment. Regarding the visible_options parameter, it's correctly named as it contains the visible options (after hiding), not the hidden ones.

Copilot AI requested a review from AtR1an January 12, 2026 14:57
@chaubold chaubold marked this pull request as ready for review January 12, 2026 15:10
@chaubold chaubold requested a review from a team as a code owner January 12, 2026 15:10
@chaubold
Copy link
Contributor

@AtR1an I like the changes. If you agree, feel free to merge

@chaubold chaubold merged commit 67c4c24 into enh/AP-25288-structured-outputs Jan 12, 2026
1 check failed
@chaubold chaubold deleted the copilot/sub-pr-37 branch January 12, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants