diff --git a/CHANGELOG b/CHANGELOG index e9184bba..3f51f62b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/openaddr/cache.py b/openaddr/cache.py index aac53f22..f06f0ef3 100644 --- a/openaddr/cache.py +++ b/openaddr/cache.py @@ -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: # diff --git a/openaddr/conform.py b/openaddr/conform.py index 5b240079..0b084140 100644 --- a/openaddr/conform.py +++ b/openaddr/conform.py @@ -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 @@ -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 = { diff --git a/openaddr/tests/__init__.py b/openaddr/tests/__init__.py index 2455e18c..be71dbca 100644 --- a/openaddr/tests/__init__.py +++ b/openaddr/tests/__init__.py @@ -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') @@ -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')