Skip to content

Bug with parsing response #175

@MatthewLoffredo

Description

@MatthewLoffredo

I keep running into an error that I think is due to how the package is parsing responses. This is the code to reproduce:

assignments = Assignment.objects.filter(assignee='University of California, Berkeley')
len(assignments)

all_patents = []
  for assignment in assignments:
  # any code here

This is the error I'm seeing:

KeyError                                  Traceback (most recent call last)
[<ipython-input-5-6369afc5e2cc>](https://localhost:8080/#) in <cell line: 5>()
      3 
      4 all_patents = []
----> 5 for assignment in assignments:
      6   try:
      7       for property in assignment.properties:

6 frames
[/usr/local/lib/python3.10/dist-packages/patent_client/_sync/uspto/assignment/convert.py](https://localhost:8080/#) in <listcomp>(.0)
     89 def zip_lists(data, input_keys, output_key):
     90     """Zip lists of data into a list of dicts"""
---> 91     tuples = list(zip(*[data[key] for key in input_keys]))
     92     dicts = [dict(zip(input_keys, t)) for t in tuples]
     93     return dicts

KeyError: 'inventionTitle'

Any help would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions