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

AssertionError for get_user_entries() when the user has a pinned entry #14

Closed
ghost opened this issue Nov 29, 2021 · 1 comment · Fixed by #15
Closed

AssertionError for get_user_entries() when the user has a pinned entry #14

ghost opened this issue Nov 29, 2021 · 1 comment · Fixed by #15
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Nov 29, 2021

>>> from eksisozluk.EksiSozluk import EksiApi
>>> client = EksiApi()
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.eksisozluk.com:443
DEBUG:urllib3.connectionpool:https://api.eksisozluk.com:443 "POST /v2/account/anonymoustoken HTTP/1.1" 200 None
DEBUG:eksisozluk.EksiSozluk:Token: EksiToken(rank=0, access_token='31hv4Vt0Jp9otf1OybxHQgHvmWSnPhfJKrJlyCxV1O87JO6GNb6nFDAE7fTFueLsGAUbQ5v3DuMVNd27-gDABWK1eP07FjCJXOvQfStDnDzjXccHYExzEYIn_Ko4p3fvySeztvXTZDlf1Z9IfuS9JRzD_WjX4McaT1Up81MGHXUo7sQZuKG7u7DcNgJr0okImkbwhHGhsZT6DreGvc3VdA', token_type='bearer', expires_in=86400, user_id=None, refresh_token=None, nick=None, issued_at=datetime.datetime(2021, 11, 29, 11, 44, 16, 934765), expires_at=datetime.datetime(2021, 11, 30, 11, 44, 16, 934765))
>>> client.get_user_entries("ssg")
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.eksisozluk.com:443
DEBUG:urllib3.connectionpool:https://api.eksisozluk.com:443 "GET /v2/user/ssg/entries?p=1 HTTP/1.1" 200 None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/x/.virtualenvs/eksisozluk/lib/python3.9/site-packages/eksisozluk/EksiSozluk.py", line 166, in get_user_entries
    return UserEntriesResponse.from_dict(response.json())
  File "/home/x/.virtualenvs/eksisozluk/lib/python3.9/site-packages/eksisozluk/Models/Responses/UserEntriesResponse.py", line 45, in from_dict
    data = UserEntries.from_dict(obj.get("Data"))
  File "/home/x/.virtualenvs/eksisozluk/lib/python3.9/site-packages/eksisozluk/Models/Responses/UserEntriesResponse.py", line 17, in from_dict
    pinned_entry = from_none(obj.get("PinnedEntry"))
  File "/home/x/.virtualenvs/eksisozluk/lib/python3.9/site-packages/eksisozluk/Models/__init__.py", line 15, in from_none
    assert x is None
AssertionError

I'm not sure how to solve it because I don't really understand the exact purpose of from_none().

@e4c6 e4c6 self-assigned this Nov 29, 2021
@e4c6 e4c6 added the bug Something isn't working label Nov 29, 2021
@e4c6 e4c6 linked a pull request Nov 29, 2021 that will close this issue
@e4c6
Copy link
Owner

e4c6 commented Nov 29, 2021

I created models using sample responses so some attributes were null, we'll eventually get to address all of these. @cagriozkurt

@e4c6 e4c6 closed this as completed Nov 29, 2021
@e4c6 e4c6 linked a pull request Nov 29, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant