Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bowtie tui command produces exception when selecting certain options #853

Closed
OptimumCode opened this issue Feb 11, 2024 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@OptimumCode
Copy link
Collaborator

When executing bowtie tui command an exception is thrown when you select one of the following groups:

  • info
  • smoke
  • summary

All other groups work normally. The interesting moment that the first group in the list (badges) works, next (info) fails, next (run) works, etc.

Error traceback
$ bowtie tui
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/oleg.smirnov/.local/pipx/venvs/bowtie-json-schema/lib/python3.10/site-packages/textual/wid │
│ get.py:3435 in _on_compose                                                                       │
│                                                                                                  │
│   3432 │   async def _on_compose(self, event: events.Compose) -> None:                           │
│   3433 │   │   event.prevent_default()                                                           │
│   3434 │   │   try:                                                                              │
│ ❱ 3435 │   │   │   widgets = [*self._pending_children, *compose(self)]                           │
│   3436 │   │   │   self._pending_children.clear()                                                │
│   3437 │   │   except TypeError as error:                                                        │
│   3438 │   │   │   raise TypeError(                                                              │
│                                                                                                  │
│ /home/oleg.smirnov/.local/pipx/venvs/bowtie-json-schema/lib/python3.10/site-packages/trogon/widg │
│ ets/parameter_controls.py:163 in compose                                                         │
│                                                                                                  │
│   160 │   │   │   │   │   │   for default_value, control_widget in zip(                          │
│   161 │   │   │   │   │   │   │   default_value_tuple, widget_group                              │
│   162 │   │   │   │   │   │   ):                                                                 │
│ ❱ 163 │   │   │   │   │   │   │   self._apply_default_value(control_widget, default_value)       │
│   164 │   │   │   │   │   │   │   yield control_widget                                           │
│   165 │   │   │   │   │   │   │   # Keep track of the first control we render, for easy focus    │
│   166 │   │   │   │   │   │   │   if first_focus_control is None:                                │
│                                                                                                  │
│ /home/oleg.smirnov/.local/pipx/venvs/bowtie-json-schema/lib/python3.10/site-packages/trogon/widg │
│ ets/parameter_controls.py:247 in _apply_default_value                                            │
│                                                                                                  │
│   244 │   │   │   control_widget.value = str(default_value)                                      │
│   245 │   │   │   control_widget.placeholder = f"{default_value} (default)"                      │
│   246 │   │   elif isinstance(control_widget, Select):                                           │
│ ❱ 247 │   │   │   control_widget.value = str(default_value)                                      │
│   248 │   │   │   control_widget.prompt = f"{default_value} (default)"                           │
│   249 │                                                                                          │
│   250 │   @staticmethod                                                                          │
│                                                                                                  │
│ /home/oleg.smirnov/.local/pipx/venvs/bowtie-json-schema/lib/python3.10/site-packages/textual/wid │
│ gets/_select.py:439 in _validate_value                                                           │
│                                                                                                  │
│   436 │   │   │   # so we provide a helpful message to catch this mistake in case people didn'   │
│   437 │   │   │   # realise we use a special value to flag "no selection".                       │
│   438 │   │   │   help_text = " Did you mean to use Select.clear()?" if value is None else ""    │
│ ❱ 439 │   │   │   raise InvalidSelectValueError(                                                 │
│   440 │   │   │   │   f"Illegal select value {value!r}." + help_text                             │
│   441 │   │   │   )                                                                              │
│   442                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
InvalidSelectValueError: Illegal select value '<function <lambda> at 0x7f655a321ea0>'.
$ bowtie --version
bowtie, version 2024.2.11
$ python3 --version
Python 3.10.13
@Julian
Copy link
Member

Julian commented Feb 11, 2024

IIRC this is a known bug in the upstream library (trogon). So I don't think there's anything we can do here but I'll have another look when I get a moment.

@OptimumCode
Copy link
Collaborator Author

If it is a known issue in another library then I personally will totally agree to wait for a fix in that library) To be honest, I used this command just out of curiosity to see what it does and this error was a result. But I didn't find any existing issue related to this problem so I decided to create one.

@Julian
Copy link
Member

Julian commented Feb 11, 2024

Yes! Definitely appreciate the report!

@Julian
Copy link
Member

Julian commented Feb 11, 2024

Textualize/trogon#51 I think might be the upstream issue

@OptimumCode
Copy link
Collaborator Author

Seems like nobody supports this repo for quite a while. If somebody fix this issue the PR most likely won't be merged for some time

@Julian
Copy link
Member

Julian commented Feb 16, 2024

I am actually going to remove this subcommand for now, and therefore to close this -- I put some ideas for a much more useful and ambitious version in #883 -- definitely your ideas are (always) welcome, and again in case it wasn't clear thanks for this report nonetheless!

@Julian Julian closed this as completed in 8cf3236 Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants