Avoid errors on missing dates in Nancy OpenData file

This commit is contained in:
Lucas Verney 2019-05-29 09:25:46 +02:00
parent 7da22205eb
commit 6669014d0c

View File

@ -261,6 +261,9 @@ def preprocess_nancy(data):
# Homogeneize geo_shape
new_fields['geo_shape'] = geometry
# Homogeneize start and end date spelling
if not new_fields['DATE_DEBUT'] or not new_fields['DATE_FIN']:
# Invalid start / end date
continue
new_fields['date_debut'] = arrow.get(
float(new_fields['DATE_DEBUT']) / 1000
).isoformat()