Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NoB0 committed Sep 11, 2024
1 parent f0ece02 commit 2886b2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/model/crb_crs/recommender/movie_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,14 @@ def get_movie_title(self, movie_id: str) -> str:
Returns:
Movie title.
"""
return self.movie_mentions_df.loc[[int(movie_id)]]["title"].iloc[0]
try:
title = self.movie_mentions_df.loc[[int(movie_id)]]["title"].iloc[
0
]
except KeyError:
title = ""
logging.error(f"Movie title not found for movie ID {movie_id}.")
return title

def replace_item_ids_with_recommendations(
self,
Expand Down

0 comments on commit 2886b2b

Please sign in to comment.