From 6669014d0ca00972d602fe604def5bcf33af8aa1 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Wed, 29 May 2019 09:25:46 +0200 Subject: [PATCH] Avoid errors on missing dates in Nancy OpenData file --- scripts/opendata/works.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/opendata/works.py b/scripts/opendata/works.py index a45d1f0..731e685 100755 --- a/scripts/opendata/works.py +++ b/scripts/opendata/works.py @@ -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()