Skip to content

Commit

Permalink
Fix similarity datasets message name (#2804)
Browse files Browse the repository at this point in the history
* Fix similarity datasets message name

Spark reader expects the names to start with similarity instead of similar.

* Fix similarity datasets message name - 2

Spark reader expects the names to start with similarity instead of similar.
  • Loading branch information
amCap1712 committed Mar 2, 2024
1 parent fdd045d commit c8b5abf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions listenbrainz_spark/similarity/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,21 @@ def main(days, session, contribution, threshold, limit, skip, is_production_data

if is_production_dataset:
yield {
"type": "similar_recordings_start",
"type": "similarity_artist_start",
"algorithm": algorithm
}

for entries in chunked(data, RECORDINGS_PER_MESSAGE):
items = [row.asDict() for row in entries]
yield {
"type": "similar_artists",
"type": "similarity_artist",
"algorithm": algorithm,
"data": items,
"is_production_dataset": is_production_dataset
}

if is_production_dataset:
yield {
"type": "similar_recordings_end",
"type": "similarity_artist_end",
"algorithm": algorithm
}
6 changes: 3 additions & 3 deletions listenbrainz_spark/similarity/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,21 @@ def main(days, session, contribution, threshold, limit, skip, is_production_data

if is_production_dataset:
yield {
"type": "similar_recordings_start",
"type": "similarity_recording_start",
"algorithm": algorithm
}

for entries in chunked(data, RECORDINGS_PER_MESSAGE):
items = [row.asDict() for row in entries]
yield {
"type": "similar_recordings",
"type": "similarity_recording",
"algorithm": algorithm,
"data": items,
"is_production_dataset": is_production_dataset
}

if is_production_dataset:
yield {
"type": "similar_recordings_end",
"type": "similarity_recording_end",
"algorithm": algorithm
}

0 comments on commit c8b5abf

Please sign in to comment.