Skip to content

ames/harvesters/caltechdata.py fails at line 35 #14

Open
@rsdoiel

Description

@rsdoiel

This came up after updating Feeds v1 to use v0.9.0 release of ames. Harvesting from CaltechDATA is aborting. The full error message is

raceback (most recent call last):
  File "/Sites/feeds.library.caltech.edu/harvest.py", line 265, in <module>
    harvest_caltechdata('etc/CaltechDATA.json')
  File "/Sites/feeds.library.caltech.edu/feeds/caltechdata.py", line 33, in harvest_caltechdata
    get_caltechdata(collection_name, production=True)
  File "/Users/datawork/Library/Python/3.10/lib/python/site-packages/ames/harvesters/caltechdata.py", line 35, in get_caltechdata
    hits += response["hits"]["hits"]
KeyError: 'hits'

I believe the issue is that line 35 uses response["hits"]["hits"] before one or other levels of the array has been initialized. If this is correct then the hits += should fall back to zero is my guess. I will test this and then do a pull request when I have a fix ready.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions