Skip to content

Commit

Permalink
Merge pull request #13 from The-Academic-Observatory/fix/missing_item
Browse files Browse the repository at this point in the history
Workaround for when "Item" field is missing
  • Loading branch information
keegansmith21 authored Aug 18, 2023
2 parents 3faf2a6 + 39d9513 commit 149e60a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,10 @@ def download_access_stats_new(
base_json["Report_Items"], ip_json["Report_Items"], country_json["Report_Items"]
):
# Use base item to get general info on book
book_title = base_item["Item"]
book_title = base_item.get("Item")
if not book_title:
print(f"Item without title skipped: {base_item}")
continue
publisher = base_item.get("Publisher", "")
event_month = base_item["Performance_Instances"][0]["Event_Month"]

Expand Down

0 comments on commit 149e60a

Please sign in to comment.