From 37bff9efec1eab59de4e7ba3187d1212befb92a1 Mon Sep 17 00:00:00 2001 From: dharvey-consbio Date: Thu, 17 Sep 2020 12:58:34 -0700 Subject: [PATCH] Fix data quality property parsing for ArcGIS parser --- gis_metadata/arcgis_metadata_parser.py | 2 +- gis_metadata/tests/data/arcgis_metadata.xml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gis_metadata/arcgis_metadata_parser.py b/gis_metadata/arcgis_metadata_parser.py index fc41256..60e3acf 100644 --- a/gis_metadata/arcgis_metadata_parser.py +++ b/gis_metadata/arcgis_metadata_parser.py @@ -298,7 +298,7 @@ def _parse_report_item(self, prop): parsed = (element_to_dict(e) for e in get_elements(self._xml_tree, xroot)) parsed = flatten_items(e['children'] for e in parsed if e['attributes'].get('type') == item_type) - return reduce_value([p['text'] for p in parsed if p['name'] == 'measDesc']) + return reduce_value([p['text'] for p in parsed if p and p['name'] == 'measDesc']) def _parse_raster_info(self, prop=RASTER_INFO): """ Collapses multiple dimensions into a single raster_info complex struct """ diff --git a/gis_metadata/tests/data/arcgis_metadata.xml b/gis_metadata/tests/data/arcgis_metadata.xml index 9775d6d..7105039 100644 --- a/gis_metadata/tests/data/arcgis_metadata.xml +++ b/gis_metadata/tests/data/arcgis_metadata.xml @@ -7,21 +7,21 @@ Attributes Alias 1 Attributes Definition 1 Attributes Definition Source 1 - + Attributes Label 2 Attributes Alias 2 Attributes Definition 2 Attributes Definition Source 2 - + Attributes Label 3 Attributes Alias 3 Attributes Definition 3 Attributes Definition Source 3 - + @@ -324,6 +324,8 @@ Process Step Date 3 Test Dataset Completeness + + dataset