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

Error with counting keys #69

Open
nleroy917 opened this issue Nov 7, 2021 · 5 comments
Open

Error with counting keys #69

nleroy917 opened this issue Nov 7, 2021 · 5 comments

Comments

@nleroy917
Copy link
Owner

Error found in function logs:

key_counts = az.key_counts(t['analysis'] for t in all_tracks_cleaned) 
File "/workspace/spottydata/analysis.py", line 320, in key_counts key = key_int_to_str(a['key']) 
TypeError: 'NoneType' object is not subscriptable
@nleroy917
Copy link
Owner Author

I also caught this in the logs:

File "/workspace/main.py", line 51, in analyze_profile top_genres = az.genre_counts(all_artists, n=5) 
File "/workspace/spottydata/analysis.py", line 237, in genre_counts for genre in artist['genres']: 
TypeError: 'NoneType' object is not subscriptable

So in the first scenario with the analysis objects, it looks like we are getting None objects for the analysis, and for the genre analysis, we are getting None objects for the artists. Which means either the analysis came back with None or the artist came back with None.

I wonder if I can filter out any None artists. As well, filtering out any tracks with None analysis would be nice too.

@nleroy917
Copy link
Owner Author

Hey, @andrewygray. Does the push I just made resolve your issues? I was making a change to add people's Wrapped playlists to the analysis, and I was finally able to reproduce the error. I made a fix. Let me know!

@aygray
Copy link

aygray commented Dec 2, 2021

@nleroy917 So I was able to get to the analysis page but it seems like it's only pulling music from my Discover Weekly Playlist and nothing else. I also have no data for the track history 🤔
CleanShot 2021-12-02 at 09 50 38
CleanShot 2021-12-02 at 09 50 24

@nleroy917
Copy link
Owner Author

Are you an author of any of your own playlists? If not... that might be why. It only looks at playlists you have specifically authored and ones created for you by Spotify.

The reason being that I found there are users out there who tend to get trigger happy with following/liking playlists and the analysis package tends to grow quite quickly when we start adding those in....

@aygray
Copy link

aygray commented Dec 2, 2021

I would say I'm the author of about 90% of my saved playlists

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

2 participants