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

Make return structure for "Get Multiple..." type APIs consistent #651

Closed
wants to merge 5 commits into from
Closed

Conversation

badfarmerjohn
Copy link

Get-Multiple APIs have a JSON response structure of with a single entry whose value is a list containing the actual requested items as dictionaries. The audio_features function in client.py was adapted to unwrap the single value in commit 9c0b872, but other functions for similar APIs (eg. tracks, artists, albums, ...) have not been adapted, leading to an inconsistent structure in the returned dictionary. This change modifies those functions to handle the response similar to audio_features.

badfarmerjohn and others added 5 commits March 4, 2021 01:04
Get-Multiple APIs have a JSON response structure of with a single entry whose value is a list containing the actual requested items as dictionaries. The audio_features function in client.py was adapted to unwrap the single value in commit 9c0b872, but other functions for similar APIs (eg. tracks, artists, albums, ...) have not been adapted, leading to an inconsistent structure in the returned dictionary. This change modifies those functions to handle the response similar to audio_features.
@badfarmerjohn badfarmerjohn marked this pull request as ready for review March 4, 2021 10:07
@stephanebruckert
Copy link
Member

Thanks for your PR, however I don't think we want this:

  • 9c0b872 looks wrong to me, as according to the doc of that endpoint we expect audio_features, not audio_attributes.
  • the above not being useful, it would be wrong to adapt other endpoints to it
  • the change would be backward-incompatible, as current apps are expecting such intermediary fields. You could still raise this in the discussion about spotipy3 Dumping improvement ideas for spotipy version 3 #652 so we can discuss it, but keep in mind that spotipy's philosophy is to remain "light" and to avoid modifying the resulting JSON

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

Successfully merging this pull request may close these issues.

2 participants