Skip to content

Commit

Permalink
Merge branch 'master' of github.com:openaddresses/batch-machine into …
Browse files Browse the repository at this point in the history
…preview-actual
  • Loading branch information
ingalls committed Sep 19, 2023
2 parents 3ad7fc2 + f4730bb commit 32e5511
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
12 changes: 7 additions & 5 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
- Rewrite confrom to natively output GeoJSON+LD
- Rewrite Preview module to expect GeoJSON+LD

2023-09-06 v8.3.0
- Update to next major alpine version
- Remove mock library in favour of unittest.mock
- Update all python deps to latest versions
2023-09-09 v8.3.1
- Use the file extension from the content-type header when it disagrees with content-disposition in https://github.com/openaddresses/batch-machine/pull/54

2023-09-05 v8.3.0
- Update Mapbox Vector Tile dependency in https://github.com/openaddresses/batch-machine/pull/52
- Make GeoJSON+LD output a default in https://github.com/openaddresses/batch-machine/pull/51
- Update TippeCanoe to latest version in https://github.com/openaddresses/batch-machine/pull/50

2023-09-05 v8.2.4
- Update TippeCanoe to latest version
- Make GeoJSON+LD output a default

2023-09-02 v8.2.3
- Fix properties in geojson-ld features in https://github.com/openaddresses/batch-machine/pull/49
- Remove extra whitespace in geojson-ld output in https://github.com/openaddresses/batch-machine/pull/48
Expand Down
7 changes: 5 additions & 2 deletions openaddr/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,11 @@ def guess_url_file_extension(url):
if path_ext == attachment_ext:
_L.debug('Content-Disposition agrees: "{}"'.format(match.group('filename')))
else:
_L.debug('Content-Disposition disagrees: "{}"'.format(match.group('filename')))
path_ext = False
_L.debug('Content-Disposition disagrees: "{}" says we should use "{}", using "{}" instead'.format(
match.group('filename'),
attachment_ext,
path_ext,
))

if not path_ext:
#
Expand Down
4 changes: 2 additions & 2 deletions openaddr/conform.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def convert(self, source_config, source_paths, workdir):
rc = conform_cli(source_config, source_path, dest_path)
if rc == 0:
with open(dest_path) as file:
addr_count = sum(1 for line in file) - 1
addr_count = sum(1 for line in file)

# Success! Return the path of the output CSV
return dest_path, addr_count
Expand Down Expand Up @@ -1083,7 +1083,7 @@ def row_convert_to_out(source_config, row):
"Convert a row from the source schema to OpenAddresses output schema"

geom = row.get(GEOM_FIELDNAME.lower(), None)
if geom == "POINT EMPTY":
if geom == "POINT EMPTY" or geom == '':
geom = None

output = {
Expand Down
9 changes: 3 additions & 6 deletions openaddr/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,16 +989,13 @@ def test_single_tx_waco(self):
source = join(self.src_dir, 'us/tx/city_of_waco.json')

with HTTMock(self.response_content):
ofs = csv.field_size_limit()
csv.field_size_limit(1)
state_path = process_one.process(source, self.testdir, "addresses", "default", False, False)
csv.field_size_limit(ofs)

with open(state_path) as file:
state = dict(zip(*json.load(file)))

self.assertEqual(state["source problem"], "Could not conform source data")
self.assertIsNone(state["processed"])
self.assertIsNone(state["source problem"])
self.assertEqual(state["processed"], 'out.geojson')

source = join(self.src_dir, 'us/tx/city_of_waco.json')

Expand All @@ -1022,7 +1019,7 @@ def test_single_tx_waco(self):
self.assertEqual(rows[0]['properties']['region'], u'TX')
self.assertEqual(rows[0]['properties']['id'], u'')
self.assertEqual(rows[0]['properties']['number'], u'308')
self.assertEqual(rows[0]['properties']['hash'], u'c782a47f7d52d99f')
self.assertEqual(rows[0]['properties']['hash'], u'431f816eebac0000')
self.assertEqual(rows[0]['properties']['city'], u'Mcgregor')
self.assertEqual(rows[0]['geometry']['coordinates'], [-97.3961768, 31.4432706]),
self.assertEqual(rows[0]['properties']['street'], u'PULLEN ST')
Expand Down

0 comments on commit 32e5511

Please sign in to comment.