diff --git a/internal/server/v2/observation/golden/direct/2024-09.json b/internal/server/v2/observation/golden/direct/2024-09.json new file mode 100644 index 000000000..25f5ca479 --- /dev/null +++ b/internal/server/v2/observation/golden/direct/2024-09.json @@ -0,0 +1,30 @@ +{ + "by_variable": { + "var_with_hyphenated_date": { + "by_entity": { + "country/USA": { + "ordered_facets": [ + { + "facet_id": "2921750529", + "observations": [ + { + "date": "2024-09", + "value": 3 + } + ], + "obs_count": 1, + "earliest_date": "2024-09", + "latest_date": "2024-09" + } + ] + } + } + } + }, + "facets": { + "2921750529": { + "import_name": "Custom Prov", + "provenance_url": "custom.datacommons.org" + } + } +} \ No newline at end of file diff --git a/internal/server/v2/observation/golden/direct_test.go b/internal/server/v2/observation/golden/direct_test.go index eebdfa640..90e018a44 100644 --- a/internal/server/v2/observation/golden/direct_test.go +++ b/internal/server/v2/observation/golden/direct_test.go @@ -93,6 +93,15 @@ func TestFetchDirect(t *testing.T) { nil, "2010.json", }, + { + []string{ + "var_with_hyphenated_date", + }, + []string{"country/USA"}, + "2024-09", + nil, + "2024-09.json", + }, { []string{ "Area_Farm", diff --git a/test/datacommons.db b/test/datacommons.db index 8c63afead..3be81e5cf 100644 Binary files a/test/datacommons.db and b/test/datacommons.db differ diff --git a/test/observations.csv b/test/observations.csv index f3e6ee78c..d13405996 100644 --- a/test/observations.csv +++ b/test/observations.csv @@ -80,3 +80,7 @@ country/USA,var_with_props,2023,1,custom,USD,,,, country/GBR,var_with_props,2023,2,custom,USD,,,, country/USA,var_with_props,2023,3,custom,GBP,,,, country/GBR,var_with_props,2023,4,custom,GBP,,,, +country/USA,var_with_hyphenated_date,2024-07,1,custom,,,,, +country/USA,var_with_hyphenated_date,2024-08,2,custom,,,,, +country/USA,var_with_hyphenated_date,2024-09,3,custom,,,,, +country/USA,var_with_hyphenated_date,2024-10,4,custom,,,,,