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

Cannot choose default value for parameters in DB editor v0.8 #2443

Closed
jkiviluo opened this issue Nov 28, 2023 · 4 comments
Closed

Cannot choose default value for parameters in DB editor v0.8 #2443

jkiviluo opened this issue Nov 28, 2023 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jkiviluo
Copy link
Member

jkiviluo commented Nov 28, 2023

As per title. Switch to parameter definition, try to choose a default for a parameter definition. Getting this in console:

AttributeError: Slot 'ChangeNotifier::_push_notification(int)' not found.

And after pulling the latest I got this:

Traceback (most recent call last):
  File "C:\data\spi-entity\Spine-Toolbox\spinetoolbox\widgets\notification.py", line 221, in _push_notification
    if self._settings.value(self._settings_key, defaultValue="2") != "2":
  File "C:\data\spi-entity\Spine-Toolbox\spinetoolbox\spine_db_commands.py", line 154, in redo
    for x in self.db_mngr.do_update_items(self.db_map, self.item_type, self.redo_data, check=self._check)
  File "C:\data\spi-entity\Spine-Toolbox\spinetoolbox\helpers.py", line 122, in new_function
    return func(*args, **kwargs)
  File "C:\data\spi-entity\Spine-Toolbox\spinetoolbox\spine_db_manager.py", line 1360, in do_update_items
    return worker.update_items(item_type, data, check)
  File "C:\data\spi-entity\Spine-Toolbox\spinetoolbox\helpers.py", line 122, in new_function
    return func(*args, **kwargs)
  File "C:\data\spi-entity\Spine-Toolbox\spinetoolbox\spine_db_worker.py", line 227, in update_items
    items, errors = self._db_map.update_items(item_type, *orig_items, check=check)
  File "C:\data\spi-entity\Spine-Toolbox\src\spinedb-api\spinedb_api\db_mapping.py", line 477, in update_items
    return self._modify_items(lambda x: self.update_item(item_type, check=check, **x), *items, strict=strict)
  File "C:\data\spi-entity\Spine-Toolbox\src\spinedb-api\spinedb_api\db_mapping.py", line 389, in _modify_items
    item, error = function(item)
  File "C:\data\spi-entity\Spine-Toolbox\src\spinedb-api\spinedb_api\db_mapping.py", line 477, in <lambda>
    return self._modify_items(lambda x: self.update_item(item_type, check=check, **x), *items, strict=strict)
  File "C:\data\spi-entity\Spine-Toolbox\src\spinedb-api\spinedb_api\db_mapping.py", line 461, in update_item
    checked_item, error = mapped_table.checked_item_and_error(kwargs, for_update=True)
  File "C:\data\spi-entity\Spine-Toolbox\src\spinedb-api\spinedb_api\db_mapping_base.py", line 418, in checked_item_and_error
    self.check_fields(candidate_item._asdict())
  File "C:\data\spi-entity\Spine-Toolbox\src\spinedb-api\spinedb_api\db_mapping_base.py", line 529, in check_fields
    raise SpineDBAPIError("\n".join(errors))
spinedb_api.exception.SpineDBAPIError: invalid type for 'name' of 'parameter_definition' - got NoneType, expected str.
@jkiviluo jkiviluo added the bug Something isn't working label Nov 28, 2023
@jkiviluo jkiviluo added this to the v0.8.0 milestone Nov 28, 2023
@jkiviluo
Copy link
Member Author

Looks like it could be SpineDB_API issue.

@manuelma
Copy link
Collaborator

Nice catch @jkiviluo - I think I just fixed it in 0.8-dev

@jkiviluo
Copy link
Member Author

jkiviluo commented Dec 5, 2023

to be tested by @jkiviluo

@jkiviluo
Copy link
Member Author

jkiviluo commented Dec 6, 2023

Seems to be working. Great, thanks!

@jkiviluo jkiviluo closed this as completed Dec 6, 2023
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