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:
@@ -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']}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user