update GeoJSON provider property typing (#1116)

This commit is contained in:
Tom Kralidis
2023-01-25 11:49:29 -05:00
committed by GitHub
parent 754bbffb94
commit 94dc76bf57
+9 -2
View File
@@ -81,8 +81,15 @@ class GeoJSONProvider(BaseProvider):
if os.path.exists(self.data):
with open(self.data) as src:
data = json.loads(src.read())
for f in data['features'][0]['properties'].keys():
fields[f] = {'type': 'string'}
for key, value in data['features'][0]['properties'].items():
if isinstance(value, float):
type_ = 'number'
elif isinstance(value, int):
type_ = 'integer'
else:
type_ = 'string'
fields[key] = {'type': type_}
else:
LOGGER.warning(f'File {self.data} does not exist.')
return fields