-
Notifications
You must be signed in to change notification settings - Fork 5
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
Write type information for simple types as well #356
Comments
Floats, booleans and strings now have explicit types in parameter_definition, parameter_value and list_value tables. Re #356
spinedb_api now requires type information for scalar parameter values. Re spine-tools/Spine-Database-API#356
This probably impacts SpineInterface, maybe substantially, any thoughts on that? |
It will impact, so we need to coordinate updates between spinedb_api and SpineInterface. I have bumped the DB server version to 8 in the PR so old versions of SpineInterface should give a proper warning. I could try to fix SpineInterface myself but I would rather see someone more knowledgeable in Julia to work on it. In any case, I am not planning to merge the PR until SpineInterface is up-to-date. I have sent a message about this to the SpineOpt channel in Element, perhaps we could continue the discussion there? |
Isn't there an alternative? The JSON standard doesn't require the type and disambiguates values depending on the internal structure ("1" is a string, 1 is a number, true is a boolean). We could use the same and also introduce an extra rule where floating point numbers need to be specified including the dot - so if one wants the number 'one' as a floating point number, they should enter 1.0. |
To me, the biggest issue is inconsistency. If the Also, this change codifies the supported types into When it comes to backwards compatibility, I am unsure if the impact is too drastic. You may need to fix some parsing functions as is the case with SpineInterface but as far as I can see, that is not totally impossible. I might be overlooking lots of stuff here, though, so let me know if you see this as a problem. |
Thanks @soininen - you're definitely right in that the impact is not impossible to absorb. I guess my main worry is the limited resources to work on SpineInterface which might require some strategic action. |
Merging the PR is not urgent. It is the summer holiday season anyway. |
ParameterValueTypeMapping now exports real scalar types, not just 'single_value'. Re #356
Looks like the changes to SpineInterface were pretty minimal, see spine-tools/SpineInterface.jl#127 |
Currently the
type
anddefault_type
fields inparameter_value
andparameter_definition
tables are set to null if the value is string, float or boolean. It works for now, but would break if we introduced e.g. integers as a new type because the meaning of e.g. JSON "1" would be ambiguous. If we were to switch from JSON to binary representation, a bag of 64 bits could mean anything from float to int to boolean. To be future proof, we should store the value type for every type we have in the database.The text was updated successfully, but these errors were encountered: