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

Bug: invalid literal for int() with base 10: '' #424

Open
saeliddp opened this issue Jul 1, 2024 · 1 comment
Open

Bug: invalid literal for int() with base 10: '' #424

saeliddp opened this issue Jul 1, 2024 · 1 comment
Assignees
Labels
bug Something isn't working 🚨 high priority🚨 We need these features/fixes for v1

Comments

@saeliddp
Copy link
Collaborator

saeliddp commented Jul 1, 2024

Investigate and fix bug that causes invalid literal for int() with base 10: '' to appear when navigating tabs. Issue found by @thao-do

@saeliddp saeliddp added bug Something isn't working 🚨 high priority🚨 We need these features/fixes for v1 labels Jul 1, 2024
@saeliddp saeliddp self-assigned this Jul 1, 2024
@saeliddp
Copy link
Collaborator Author

saeliddp commented Jul 1, 2024

Here's what was happening:

  1. the combobox for training channel selection is initialized with no options (corresponds to index=-1)
  2. navigating to training will populate the combobox based on the CSVs generated by curation (and combo changes to index=0). This will emit an index changed signal, which is what we want since we need to update the model state based on the currently selected channel.
  3. However, if you navigate back to training after the combobox has already been populated, the combobox will reload (which means clearing itself and repopulating based on the selected csv directory). Upon clearing itself, the index will change to -1 automatically, which will emit an index changed signal.
  4. For some reason, we were listening the currentTextChanged signal instead of the currentIndexChanged signal, so when the index changed to -1, we would get the current text (which was an empty string), and try to convert it to an int to save in the model. This is where the error pops up.

Note: this also means that you get the same error when you change the csv directory on the training UI.

Solution

  1. listen to the currentIndexChanged signal instead of currentTextChanged
  2. wire the signal to a handler that can handle index=-1 properly

#423 unintentionally solves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🚨 high priority🚨 We need these features/fixes for v1
Projects
None yet
Development

No branches or pull requests

1 participant