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

Getting featured playlists throws an error #212

Closed
jingw222 opened this issue Sep 4, 2020 · 3 comments
Closed

Getting featured playlists throws an error #212

jingw222 opened this issue Sep 4, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@jingw222
Copy link
Contributor

jingw222 commented Sep 4, 2020

Hey,

This is pretty weird, because it had worked normally like hours before, and suddenly this happened.

msg, playlists = spotify.featured_playlists()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-31-14336a9bdcf5> in <module>
----> 1 msg, playlists = spotify.featured_playlists()

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_sender/client.py in wrapper(self, *args, **kwargs)
     77 
     78             response = self.send(request)
---> 79             return post_func(request, response, *params)
     80         return wrapper
     81     return decorator

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_client/decor/__init__.py in parse_response(request, response)
     19     def parse_response(request, response):
     20         handle_errors(request, response)
---> 21         return post_func(response.content)
     22 
     23     return _send_and_process(parse_response)

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_client/process.py in post_func(json)
     38     """Run json dict through multiple processors."""
     39     def post_func(json: dict):
---> 40         return tuple(processor(json) for processor in args)
     41     return post_func

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_client/process.py in <genexpr>(.0)
     38     """Run json dict through multiple processors."""
     39     def post_func(json: dict):
---> 40         return tuple(processor(json) for processor in args)
     41     return post_func

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_client/process.py in post_func(json)
     23     def post_func(json: dict):
     24         json = json if from_item is None else json[from_item]
---> 25         return type_(**json) if json is not None else None
     26     return post_func
     27 

<string> in __init__(self, href, items, limit, next, total, offset, previous)

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_model/playlist.py in __post_init__(self)
    142 
    143     def __post_init__(self):
--> 144         self.items = ModelList(SimplePlaylist(**p) for p in self.items)

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_model/playlist.py in <genexpr>(.0)
    142 
    143     def __post_init__(self):
--> 144         self.items = ModelList(SimplePlaylist(**p) for p in self.items)

<string> in __init__(self, id, href, type, uri, collaborative, external_urls, images, name, owner, public, snapshot_id, primary_color, description, tracks)

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_model/playlist.py in __post_init__(self)
    118 
    119     def __post_init__(self):
--> 120         super().__post_init__()
    121         self.tracks = Tracks(**self.tracks)
    122 

~/.pyenv/versions/3.7.5/envs/spolarfy/lib/python3.7/site-packages/tekore/_model/playlist.py in __post_init__(self)
    108     def __post_init__(self):
    109         self.images = ModelList(Image(**i) for i in self.images)
--> 110         self.owner = PublicUser(**self.owner)
    111 
    112 

TypeError: type object argument after ** must be a mapping, not NoneType

@jingw222 jingw222 added the bug Something isn't working label Sep 4, 2020
@felix-hilden
Copy link
Owner

Oh! Thank you, I confirmed it too. Looks like the owner object is nullable now. Feel free to dig around for more info if there is any (i.e. object model docs or the reference page) and shoot a PR if you'd like. Otherwise I'll take a look during the weekend.

@jingw222
Copy link
Contributor Author

jingw222 commented Sep 5, 2020

Just created a PR. If everything goes well, please close this. :D

@felix-hilden
Copy link
Owner

@jingw222 The change is now in the latest release!

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

No branches or pull requests

2 participants