-
Notifications
You must be signed in to change notification settings - Fork 80
Fixes 1880 #2247
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
Fixes 1880 #2247
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #2247 +/- ##
==========================================
+ Coverage 92.81% 92.82% +0.01%
==========================================
Files 171 171
Lines 18906 18914 +8
==========================================
+ Hits 17547 17557 +10
+ Misses 1359 1357 -2
Continue to review full report at Codecov.
|
# current_map.index are supersets of md_template.columns and | ||
# md_template.index, respectivelly, so this will not fail | ||
current_map = current_map[ | ||
md_template.columns].loc[md_template.index] |
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.
Is there a reason to do this way instead of current_map = current_map.loc[md_template.index, md_template.columns]
?
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 don't think so. I know that sometimes one option is creating a view while the other one returning an actual pandas DataFrame object, and that can raise Warning in some operations. I don't think it actually matters here, but I wanted to minimize code modifications (I'm actually just moving code around in this PR to be able to reuse code easily).
👍 |
I approved, just had the question for learning purposes. Not sure @wasade
has finished review? Can merge if so.
…On Mon, Aug 21, 2017 at 11:49 AM Jose Navas ***@***.***> wrote:
Thanks @wasade <https://github.com/wasade> / @tanaes
<https://github.com/tanaes> - able to merge? (I don't want to do a self
high-five 😄 )
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2247 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AH6JAC7aeY4R4ymLuiL8ATvoYmvpSPlJks5sadE4gaJpZM4O9iPp>
.
|
Fixes #1880
Basically the problem was in this function:
https://github.com/biocore/qiita/blob/a369cad63827b92e89032c8e12d5865c61f73a5b/qiita_ware/dispatchable.py#L198-L204
The serial calls to extend and update was forcing a validation on the "extend" call first (which raised the warning message) and another on the update, which it corrected the values in the DB (but didn't remove the previous warning).
By creating a function that performs those 2 operations at the same time and issuing a single validation at the end of that function we only raise a warning at the end if there is a problem with the data in the DB at the end of the operation.