Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LB-146: Fix fetch of listens from listenstore in user export #161

Merged
merged 3 commits into from Apr 3, 2017

Conversation

paramsingh
Copy link
Collaborator

The call to db_conn.fetch_listens was not correct as it didn't have
from_ts or to_ts. To get all listens, add a loop that makes
repeated queries to the listenstore until there are no more listens
left to get.

Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks promising, but we should really add an integration test while we're futzing with the code.

The call to db_conn.fetch_listens was not correct as it didn't have
from_ts or to_ts. To get all listens, add a loop that makes
repeated queries to the listenstore until there are no more listens
left to get.
@paramsingh
Copy link
Collaborator Author

Test added :)

@paramsingh paramsingh force-pushed the views/user-export branch 2 times, most recently from 04133be to 7b308fb Compare March 31, 2017 15:34
Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting a test fail on the new test now:

    # now export data and check if contains all the listens we just sent
    resp = self.client.post(url_for('user.export_data'))
    self.assert200(resp)
    data = json.loads(resp.data)
  self.assertEquals(len(data), 2)

E AssertionError: 5 != 2

Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass now, thanks!

@mayhem mayhem merged commit 4464290 into metabrainz:master Apr 3, 2017
@paramsingh paramsingh deleted the views/user-export branch July 6, 2017 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants