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

KeyError 'parameters' when updating a component in/to inventree #217

Closed
tomse opened this issue Mar 7, 2024 · 5 comments · Fixed by #221
Closed

KeyError 'parameters' when updating a component in/to inventree #217

tomse opened this issue Mar 7, 2024 · 5 comments · Fixed by #221
Labels
bug Something isn't working

Comments

@tomse
Copy link

tomse commented Mar 7, 2024

kintree 1.0.7 (windows)

trying to update a component from lcsc creates this error with inventree 0.14.1

[MAIN] Searching for original part in database←[0m ←[92m[INFO] Success: Found original part in database (ID = 234 | Description = "TSSOP-20 ADC/DAC - Specialized ROHS")←[0m ←[93m[INFO] Warning: The following parameters were not found in supplier data: ['Clock Frequency', 'Speed', 'Data Rate', 'Frequency Range', '-3db Bandwidth', 'Translator Type', 'Technology', 'Core Processor', 'Type', 'Sensor Type', 'Program Memory Size', 'Memory Size', 'Channels per Circuit', 'Package / Case', 'Voltage - VCCA', 'Voltage - VCCB', 'Voltage - Supply', 'Voltage - Supply (Vcc/Vdd)', 'Voltage - Supply, Digital', 'Voltage - Supply, Single (V+)', 'Operating Temperature']←[0m Exception in thread Thread-174 (create_part): Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 1045, in _bootstrap_inner self.run() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\kintree\gui\views\main.py", line 1380, in create_part alt_result = inventree_interface.inventree_create_alternate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\kintree\database\inventree_interface.py", line 813, in inventree_create_alternate inventree_part = translate_form_to_inventree( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\kintree\database\inventree_interface.py", line 357, in translate_form_to_inventree for search_param in part_info['parameters'].keys(): ~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'parameters'

kintree 1.0.4 (ubuntu 20.04 - running in WSL on windows) (for some reason it wont upgrade using pip install kintree --upgrade)

[MAIN] Searching for original part in database [INFO] Success: Found original part in database (ID = 234 | Description = "TSSOP-20 ADC/DAC - Specialized ROHS") [INFO] Warning: The following parameters were not found in supplier data: ['Clock Frequency', 'Speed', 'Data Rate', 'Frequency Range', '-3db Bandwidth', 'Translator Type', 'Technology', 'Core Processor', 'Type', 'Sensor Type', 'Program Memory Size', 'Memory Size', 'Channels per Circuit', 'Package / Case', 'Voltage - VCCA', 'Voltage - VCCB', 'Voltage - Supply', 'Voltage - Supply (Vcc/Vdd)', 'Voltage - Supply, Digital', 'Voltage - Supply, Single (V+)', 'Operating Temperature'] Exception in thread Thread-105: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/user/.local/lib/python3.8/site-packages/kintree/gui/views/main.py", line 1268, in create_part alt_result = inventree_interface.inventree_create_alternate( File "/home/user/.local/lib/python3.8/site-packages/kintree/database/inventree_interface.py", line 739, in inventree_create_alternate inventree_part = translate_form_to_inventree( File "/home/user/.local/lib/python3.8/site-packages/kintree/database/inventree_interface.py", line 313, in translate_form_to_inventree for search_param in part_info['parameters'].keys(): KeyError: 'parameters'

@tomse tomse changed the title KeyError 'parameters' when updating to inventree KeyError 'parameters' when updating a component in/to inventree Mar 7, 2024
@T0jan
Copy link
Collaborator

T0jan commented Mar 11, 2024

hi @tomse

I can't reproduce it generally with v1.0.7. Please try first to install v1.0.7 and give it another shot afterwards, as there were various bugs between 1.0.4 and 1.0.7.

If it is still not working afterwards please provide more info, at least which part in LCSC causes the problems.

@tomse
Copy link
Author

tomse commented Mar 11, 2024

hi @tomse

I can't reproduce it generally with v1.0.7. Please try first to install v1.0.7 and give it another shot afterwards, as there were various bugs between 1.0.4 and 1.0.7.

If it is still not working afterwards please provide more info, at least which part in LCSC causes the problems.

The first error is running 1.0.7 on windows (so I am running the latest version), the second is just for reference.. the item was added using kintree 1.0.6 without problems.

this is updating the item and not adding as a new item

LCSC part: C131154

@T0jan
Copy link
Collaborator

T0jan commented Mar 11, 2024

confirmed as bug with 0.14.1.

@T0jan
Copy link
Collaborator

T0jan commented Mar 11, 2024

bug is caused by parts without parameters (not limited to LCSC), commited a fix which we be part of the next version.

@tomse
Copy link
Author

tomse commented Mar 12, 2024

Thanks again :-D

@eeintech eeintech mentioned this issue Mar 28, 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

Successfully merging a pull request may close this issue.

2 participants