Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with parsing response #175

Open
MatthewLoffredo opened this issue Aug 14, 2024 · 0 comments
Open

Bug with parsing response #175

MatthewLoffredo opened this issue Aug 14, 2024 · 0 comments

Comments

@MatthewLoffredo
Copy link

MatthewLoffredo commented Aug 14, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant