Closed willu47 closed 4 years ago
@willu47 Thanks for the report!
Sorry for the late reply but it seems 0.05
was mistakenly added to missingValues
:
{
"path": "data/DiscountRate.csv",
"profile": "tabular-data-resource",
"name": "DiscountRate",
"format": "csv",
"mediatype": "text/csv",
"encoding": "utf-8",
"schema": {
"fields": [
{
"name": "REGION",
"type": "string",
"format": "default"
},
{
"name": "VALUE",
"type": "number",
"format": "default"
}
],
"missingValues": [
"0.05"
],
"foreignKeys": [
{
"fields": "REGION",
"reference": {
"resource": "REGION",
"fields": "VALUE"
}
}
],
"primaryKey": [
"REGION"
]
}
},
It's the reason why it's None
in the output data
Overview
This bug results in a
None
value when reading a resource in a tabular data package of typenumber
when the value includes one leading zero e.g.0.05
and the correct decimal value when prefaced with another zero or+
. For example:0.05
returns None00.05
returnsDecimal(0.05)
+0.05
returnsDecimal(0.05)
To replicate this bug, please run the following code:
[['SIMPLICITY', None]]
Then, inspect
https://github.com/OSeMOSYS/simplicity/blob/f0b50594360a92c4a9c70dd0465a3f8751f090a2/data/DiscountRate.csv
and observe data in0.05
format.If you copy this file locally, and change the values of the file in
data/DiscountRate.csv
you'll see this bug in action!Please preserve this line to notify @roll (lead of this repository)