Closed jkiviluo closed 7 months ago
Here's a code that fails on the attached DB (change the path):
import spinedb_api as api from spinedb_api import DatabaseMapping url_db_out = "sqlite:///[PATH_TO_DB]/flextool_input_data.sqlite" parsed_value = api.TimeSeriesFixedResolution( api.DateTime("2023-01-01T00:00"), # start "1D", # resolution [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], # values ignore_year=False, repeat=False, ) with DatabaseMapping(url_db_out) as db_flextool: value, type_ = api.to_database(parsed_value) foo = db_flextool.add_item("parameter_value", check=False, entity_class_name="node", parameter_definition_name="inflow", entity_byname=("east",), alternative_name="east", value=value, type=type_)
The code works if check=True
check=True
Other issues to improve:
flextool_input_data.txt
This is supposed to fail - check=False assumes all the reference ids are provided by the client. I think we should undocument the keyword argument and keep it only for internal purposes.
check=False
Here's a code that fails on the attached DB (change the path):
The code works if
check=True
Other issues to improve:
flextool_input_data.txt