From 95384e5a2c40b51a71c2aa006dd4326fc4b2f38b Mon Sep 17 00:00:00 2001 From: Al Date: Fri, 2 Sep 2016 14:29:40 -0400 Subject: [PATCH] [openaddresses adding hack for Honolulu until join function can handle null in OpenAddresses --- scripts/geodata/openaddresses/formatter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/geodata/openaddresses/formatter.py b/scripts/geodata/openaddresses/formatter.py index 774e188c..71d871fe 100644 --- a/scripts/geodata/openaddresses/formatter.py +++ b/scripts/geodata/openaddresses/formatter.py @@ -277,6 +277,8 @@ class OpenAddressesFormatter(object): is_netherlands = country_dir == 'nl' # HACK: remove when join function handles nulls is_italy = country_dir == 'it' + # HACK: remove when join function handles nulls + is_honololu = path.endswith('honolulu.csv') for row in reader: try: @@ -304,6 +306,10 @@ class OpenAddressesFormatter(object): if key == AddressFormatter.HOUSE_NUMBER and is_netherlands: value = self.dutch_house_number(value) + # HACK: remove when join function handles nulls + if key == AddressFormatter.HOUSE_NUMBER and is_honololu: + value = value.strip('- ') + # HACK: remove when join function handles nulls if key == AddressFormatter.HOUSE_NUMBER and is_italy: value = self.italian_house_number(value)