[openaddresses adding hack for Honolulu until join function can handle null in OpenAddresses

This commit is contained in:
Al
2016-09-02 14:29:40 -04:00
parent eab8765ac8
commit 95384e5a2c

View File

@@ -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)