Commit 3518530
authored
Quoted date string when fetching obserations (#1459)
This fixes a bug where requesting observations for a date that contains
a hyphen (Example: `2024-09`) would return an empty result set.
Before:
```
curl -XPOST "http://localhost:8080/core/api/v2/observation" -d '
{
"select": [
"date",
"value",
"variable",
"entity"
],
"entity": {
"expression": "country/USA<-containedInPlace+{typeOf:State}"
},
"variable": {
"dcids": [
"Count_SubsidizedHousingUnit"
]
},
"date": "2023-12-31"
}
'
```
Returns
```
{"byVariable":{"Count_SubsidizedHousingUnit":{}}}
```
After:
Returns
```
{"byVariable":{"Count_SubsidizedHousingUnit":{"byEntity":{"geoId/40":{"orderedFacets":[{"facetId":"4243125145","observations":[{"date":"2023-12-31","value":53562}],"obsCount":1,"earliestDate":"2023-12-31","latestDate":"2023-12-31"}]},"geoId/41":{"orderedFacets":[{"facetId":"4243125145","observations":[{"date":"2023-12-31","value":57113}],"obsCount":1,"earliestDate":"2023-12-31","latestDate":"2023-12-31"}]},"geoId/02":{"orderedFacets":[{"facetId":"4243125145","observations":[{"date":"2023-12-31","value":7962}],"obsCount":1,"earliestDate":"2023-12-31","latestDate":"2023-12-31"}]}, ... }}
```
TODO: Add test cases1 parent fdd6b39 commit 3518530
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
0 commit comments