spine-tools / Spine-Database-API

Database interface to Spine generic data model
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
6 stars 5 forks source link

Fix Traceback in get_parameter_value_item() #402

Closed soininen closed 4 months ago

soininen commented 4 months ago

This PR fixes DatabaseMapping.get_parameter_value_item() which would Traceback when the parameter definition used a value list but the parameter value did not exists, e.g. when it is not defined in a specific alternative.

Fixes #401

Checklist before merging

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 78.23%. Comparing base (5be24ac) to head (2505b0c).

Files Patch % Lines
spinedb_api/mapped_items.py 66.66% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #402 +/- ## ========================================== - Coverage 78.24% 78.23% -0.01% ========================================== Files 76 76 Lines 9501 9506 +5 Branches 2013 2014 +1 ========================================== + Hits 7434 7437 +3 - Misses 1734 1735 +1 - Partials 333 334 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.