Skip to content

Commit

Permalink
use dict.get() in kml
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed May 7, 2024
1 parent 967ffc1 commit 151b1f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions asf_search/export/kml.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ def getItem(self, p):
# Helper method for getting additional fields in <ul> tag
def metadata_fields(self, item: Dict):
required = {
'Processing type: ': item['processingTypeDisplay'],
'Frame: ': item['frameNumber'],
'Path: ': item['pathNumber'],
'Orbit: ': item['orbit'],
'Start time: ': item['startTime'],
'End time: ': item['stopTime'],
'Processing type: ': item.get('processingTypeDisplay'),
'Frame: ': item.get('frameNumber'),
'Path: ': item.get('pathNumber'),
'Orbit: ': item.get('orbit'),
'Start time: ': item.get('startTime'),
'End time: ': item.get('stopTime'),
}

optional = {}
Expand Down
2 changes: 1 addition & 1 deletion asf_search/search/search_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def as_ASFProduct(item: Dict, session: ASFSession) -> ASFProduct:

# if there's a direct entry in our dataset to product type dict
# perf = time.time()
subclass = dataset_collections.get(product_type_key)
subclass = dataset_to_product_types.get(product_type_key)
if subclass is not None:
# ASF_LOGGER.warning(f'subclass selection time {time.time() - perf}')
return subclass(item, session=session)
Expand Down

0 comments on commit 151b1f2

Please sign in to comment.