fix float detection for ES provider (#836)

* fix float detection for ES provider

* fix float detection for ES provider

* fix typo
This commit is contained in:
Tom Kralidis
2021-12-26 20:14:43 -05:00
committed by GitHub
parent f79cd3d963
commit aa8eee662c
3 changed files with 5 additions and 2 deletions
+2
View File
@@ -146,6 +146,8 @@ class ElasticsearchProvider(BaseProvider):
fields_[k] = {'type': 'string'}
elif v['type'] == 'date':
fields_[k] = {'type': 'string', 'format': 'date'}
elif v['type'] == 'float':
fields_[k] = {'type': 'number', 'format': v['type']}
else:
fields_[k] = {'type': v['type']}
+1 -1
View File
@@ -3,7 +3,7 @@
## Test data
Test data used is a subset of the [Canadian National Water Data Archive](https://www.canada.ca/en/environment-climate-change/services/water-overview/quantity/monitoring/survey/data-products-services/national-archive-hydat.html)
as extracted from the [MSC Geomet OGC API](https://eccc-msc.github.io/open-data/msc-geomet/web-services_en/#ogc-api-features) service.
as extracted from the [MSC GeoMet OGC API](https://eccc-msc.github.io/open-data/msc-geomet/web-services_en/#ogc-api-features) service.
## Running
+2 -1
View File
@@ -150,7 +150,8 @@ def test_query(config):
fields = p.get_fields()
assert len(fields) == 37
assert fields['scalerank']['type'] == 'long'
assert fields['changed']['type'] == 'float'
assert fields['changed']['type'] == 'number'
assert fields['changed']['format'] == 'float'
assert fields['ls_name']['type'] == 'string'
results = p.query()