You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be an issue with the dicts that are returned when using .data method on the one of the objects resulting from the search function.
For example, the following few lines of code should print the number of items in the dict:
import discogs_client
client = discogs_client.Client(use_agent="USER_AGENT", user_token="USER_TOKEN")
results = client.search("Daft Punk One more time", type="master")
print(len(results[0].data.items()))
print(len(results[1].data.items()))
And the output of this code is:
>>> 34
>>> 19
Oddly, it sometimes happens that all dict items have 19 key-value pairs, including the first one - without even changing the code.
Moreover, when inspecting these 2 dicts, I notice that the last key in the first result is "embed" while in the second it's "community". And even more importantly for my use case, the "artists" key is missing in the all the results except the first one.
I'm using version 2.6 of the python3-discogs-client package with dedicated conda environment using Python 3.8.
Any help here would be appreciated!
The text was updated successfully, but these errors were encountered:
Yeah, I've been having trouble with this too. For example, sometimes release.data["artists"] will result in a KeyError. For the most part I've been successful calling release.refresh() and then checking for the missing keys again, but I've also come across a few cases where the value was truly blank on the release page (e.g. no country specified)
in which case, the key would remain missing even after calling release.refresh(). This behavior is definitely inconsistent considering some attributes like "year' will return as 0 if they don't have a value. I can only assume this has to do with how they're being stored in the discogs db and how discogs API is returning the data.
Hi everyone!
There seems to be an issue with the dicts that are returned when using
.data
method on the one of the objects resulting from thesearch
function.For example, the following few lines of code should print the number of items in the dict:
And the output of this code is:
Oddly, it sometimes happens that all dict items have 19 key-value pairs, including the first one - without even changing the code.
Moreover, when inspecting these 2 dicts, I notice that the last key in the first result is
"embed"
while in the second it's"community"
. And even more importantly for my use case, the"artists"
key is missing in the all the results except the first one.I'm using version 2.6 of the
python3-discogs-client
package with dedicatedconda environment
usingPython 3.8
.Any help here would be appreciated!
The text was updated successfully, but these errors were encountered: