-
Notifications
You must be signed in to change notification settings - Fork 322
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
DataSet.get_data bugs with start/end arguments #1386
DataSet.get_data bugs with start/end arguments #1386
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1386 +/- ##
==========================================
+ Coverage 73.38% 73.45% +0.06%
==========================================
Files 79 79
Lines 9282 9283 +1
==========================================
+ Hits 6812 6819 +7
+ Misses 2470 2464 -6 |
@QCoDeS/core ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. I have the feeling that the test could be written without the mechanisms that almost (but not quite, which is important here) duplicate the existing fixtures, but after discussions with @astafan8, I feel that such a rewrite would probably be too much work for too little actual gain.
The non-test part looks like a clear improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left a few small comments
Merge: bb07fa0 a573667 Author: Jens Hedegaard Nielsen <[email protected]> Merge pull request #1386 from astafan8/bug/get_data_selected_rows
Fixes #1384.
There are two bugs in the underlying
get_data
function ofsqlite_base.py
:0
are treated asNone
where
clause forstart
for the case where bothstart
andend
are notNone
This PR fixes both.
Note that the current behavior suggests a
1
-based indexing (unlike python0
-based), with bothstart
andend
indexes being included into retuned data. This behavior is captured by the test suite.Ideally, the very same test should be done for
get_data
fromsqlite_base.py
but did not make it to this PR in order to avoid code duplication.Note that
get_data
fromsqlite_base.py
was also refactored to reduce the possibility for bugs like the ones mentioned above. In case it made the function less readable, the refactoring can be reverted.