IBM / elasticsearch-spark-recommender

Use Jupyter Notebooks to demonstrate how to build a Recommender with Apache Spark & Elasticsearch
https://developer.ibm.com/code/patterns/build-a-recommender-with-apache-spark-and-elasticsearch/
Apache License 2.0
841 stars 266 forks source link

'Recommedation' errors #16

Closed rhagarty closed 7 years ago

rhagarty commented 7 years ago

@MLnick - I grabbed the latest, and I'm still having issues with this.

Again, I did NOT install 'tmdbsimple' and skipped the 'optional' step of connecting to the TMDB API. Then when I get to the 'recommendation' steps, they all give me the same error:


UnboundLocalError Traceback (most recent call last)

in () ----> 1 display_similar(1, num=5, q="genres:children") in display_similar(the_id, q, num, index, dt) 144 """ 145 movie, recs = get_similar(the_id, q, num, index, dt) --> 146 q_im_url = get_poster_url(movie['tmdbId']) 147 if q_im_url == "NA": 148 display(HTML("Cannot import tmdbsimple. No movie posters will be displayed!")) in get_poster_url(id) 10 poster_url = IMAGE_URL + movie['poster_path'] if 'poster_path' in movie and movie['poster_path'] is not None else "" 11 return poster_url ---> 12 except APIKeyError as ae: 13 return "KEY_ERR" 14 except ModuleNotFoundError as me: UnboundLocalError: local variable 'APIKeyError' referenced before assignment Maybe we should make this a MANDATORY step and force the user to figure out how to correctly install tmdbsimple?
MLnick commented 7 years ago

Ah ok. I see the issue and will push a fix for it On Thu, 12 Oct 2017 at 22:34, Rich Hagarty notifications@github.com wrote:

@MLnick https://github.com/mlnick - I grabbed the latest, and I'm still having issues with this.

Again, I did NOT install 'tmdbsimple' and skipped the 'optional' step of connecting to the TMDB API. Then when I get to the 'recommendation' steps, they all give me the same error:

UnboundLocalError Traceback (most recent call last) in () ----> 1 display_similar(1, num=5, q="genres:children")

in display_similar(the_id, q, num, index, dt) 144 """ 145 movie, recs = get_similar(the_id, q, num, index, dt) --> 146 q_im_url = get_poster_url(movie['tmdbId']) 147 if q_im_url == "NA": 148 display(HTML("Cannot import tmdbsimple. No movie posters will be displayed!"))

in get_poster_url(id) 10 poster_url = IMAGE_URL + movie['poster_path'] if 'poster_path' in movie and movie['poster_path'] is not None else "" 11 return poster_url ---> 12 except APIKeyError as ae: 13 return "KEY_ERR" 14 except ModuleNotFoundError as me:

UnboundLocalError: local variable 'APIKeyError' referenced before assignment

Maybe we should make this a MANDATORY step and force the user to figure out how to correctly install tmdbsimple?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IBM/elasticsearch-spark-recommender/issues/16, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_SB1XP8XGnkBScnFwdYq6JWiSzSFn5ks5srne9gaJpZM4P3lmM .