Skip to content

Commit

Permalink
Patch decimal return type serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjacobson committed Feb 14, 2024
1 parent 7029d77 commit 8b0b180
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def get_remixable_tracks(args):
tracks = []
for result in results:
track = result[0]
score = result[-1]
# Convert decimal to int
score = int(result[-1])
track = helpers.model_to_dictionary(track)
track["score"] = score
tracks.append(track)
Expand Down
3 changes: 2 additions & 1 deletion packages/discovery-provider/src/queries/get_top_playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def get_top_playlists_sql(kind: TopPlaylistKind, args: GetTopPlaylistsArgs):
for result in playlist_results:
# The playlist is the portion of the query result before repost_count and score
playlist = result[0:-2]
score = result[-1]
# Convert decimal to int
score = int(result[-1])

# Convert the playlist row tuple into a dictionary keyed by column name
playlist = helpers.tuple_to_model_dictionary(playlist, Playlist)
Expand Down

0 comments on commit 8b0b180

Please sign in to comment.