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

Meaningful exception when loading/creating dataset for non-existing run id #1328

Conversation

astafan8
Copy link
Contributor

Currently when one uses load_by_id for non-existing run_id, the exception looks like "Expected one row". This PR fixes it with:

  • add run_exists method to sqlite_base
  • call run_exists in DataSet constructor and raise exception with clear message if the run_id does not exist
  • tests

Note that the used query seems to be quite fast according to this stackoverflow discussion.

@codecov
Copy link

codecov bot commented Oct 19, 2018

Codecov Report

Merging #1328 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1328      +/-   ##
==========================================
+ Coverage   72.51%   72.53%   +0.01%     
==========================================
  Files          74       74              
  Lines        8564     8570       +6     
==========================================
+ Hits         6210     6216       +6     
  Misses       2354     2354

Copy link
Collaborator

@jenshnielsen jenshnielsen left a comment

Choose a reason for hiding this comment

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

Looks good to me, codacy seems to be confused about valid syntax for line continuation

Copy link
Contributor

@WilliamHPNielsen WilliamHPNielsen left a comment

Choose a reason for hiding this comment

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

I'll leave it up to you whether to make codacy happy. We can merge this now.

@astafan8 astafan8 merged commit d785898 into microsoft:master Oct 23, 2018
@astafan8 astafan8 deleted the feature/load_by_id_bad_run_id_better_exception branch October 23, 2018 10:19
giulioungaretti pushed a commit that referenced this pull request Oct 23, 2018
Merge: 6a411be 9747c12
Author: Mikhail Astafev <astafan8@gmail.com>

    Merge pull request #1328 from astafan8/feature/load_by_id_bad_run_id_better_exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants