Skip to content

Commit

Permalink
Fix KeyError in spark reader (#1369)
Browse files Browse the repository at this point in the history
* Fix key name

* Fix tests as well
  • Loading branch information
amCap1712 committed Apr 2, 2021
1 parent 0f37c15 commit 792e3d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion listenbrainz/spark/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def notify_artist_relation_import(data):
if current_app.config['TESTING']:
return

artist_relation_name = data['import_artist_relation']
artist_relation_name = data['imported_artist_relation']
import_time = data['import_time']
time_taken_to_import = data['time_taken_to_import']

Expand Down
4 changes: 2 additions & 2 deletions listenbrainz/spark/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def test_notify_artist_relation_import(self, mock_send_mail):
# testing, should not send a mail
self.app.config['TESTING'] = True
notify_artist_relation_import({
'import_artist_relation': artist_relation_name,
'imported_artist_relation': artist_relation_name,
'import_time': str(import_time),
'time_taken_to_import': str(time_taken_to_import),
})
Expand All @@ -441,7 +441,7 @@ def test_notify_artist_relation_import(self, mock_send_mail):
# in prod now, should send it
self.app.config['TESTING'] = False
notify_artist_relation_import({
'import_artist_relation': artist_relation_name,
'imported_artist_relation': artist_relation_name,
'import_time': str(import_time),
'time_taken_to_import': str(time_taken_to_import),
})
Expand Down

0 comments on commit 792e3d6

Please sign in to comment.