Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero prefixed house numbers #163

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Conversation

missinglink
Copy link
Member

following on from #162 this PR addresses some issues and omissions I discovered when updating the importers:

  1. A house number of many zero (such as 00000) would return an empty string and error, this actually occurs in live data, we now squash it to 0.

  2. The 'name' field(s) were not being updated. I thought through a few different options including updating all the importers directly and settled on this code which handles it fairly elegantly.

@missinglink missinglink force-pushed the zero_prefixed_house_numbers branch 2 times, most recently from 091b60d to 2053a20 Compare February 18, 2025 14:52
@missinglink
Copy link
Member Author

diff --git a/test/data/expected.json b/test/data/expected.json
index 9cc6135..20841c2 100644
--- a/test/data/expected.json
+++ b/test/data/expected.json
@@ -184,13 +184,13 @@
     "_id": "openaddresses:address:input_file_1:f026cd5494a7e4f4",
     "data": {
       "name": {
-        "default": "00 Elm St"
+        "default": "0 Elm St"
       },
       "phrase": {
-        "default": "00 Elm St"
+        "default": "0 Elm St"
       },
       "address_parts": {
-        "number": "00",
+        "number": "0",
         "street": "Elm St"
       },
       "center_point": {
@@ -207,13 +207,13 @@
     "_id": "openaddresses:address:input_file_1:4509c0194f1efaca",
     "data": {
       "name": {
-        "default": "00300 Main St"
+        "default": "300 Main St"
       },
       "phrase": {
-        "default": "00300 Main St"
+        "default": "300 Main St"
       },
       "address_parts": {
-        "number": "00300",
+        "number": "300",
         "street": "Main St"
       },
       "center_point": {

@missinglink missinglink force-pushed the zero_prefixed_house_numbers branch from 2053a20 to f589a56 Compare February 18, 2025 14:57
@missinglink missinglink merged commit a9ea95f into master Feb 18, 2025
5 checks passed
@missinglink missinglink deleted the zero_prefixed_house_numbers branch February 18, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant