-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Fix to_gbq method when verbose=False #13244
Conversation
self._print("\rStreaming Insert is {0}% Complete".format( | ||
((total_rows - remaining_rows) * 100) / total_rows)) | ||
if self.verbose: | ||
self._print("\rStreaming Insert is {0}% Complete".format( |
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.
self._print
already checks for self.verbose
how does this help?
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.
total_rows
is assigned after a check for verbose
at line 430, so presently this fails because it can't evaluate the unassigned variable. If self._print
is already checking for verbose
, perhaps removing the conditional at line 429 and always assigning total_rows
is the better move?
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.
oh u mean it's None
yes it should be valid (can even be -1) or whatever
@cgrin an you update |
@jreback I can't test this, but I suppose this is good to merge? (I restarted the tests, was only a failing test related to Yahoo/Google datareader) |
I don't merge these until someone posts a local run |
but this does look trivial |
@parthea Would you be able to test this? |
Current coverage is 87.82% (diff: 0.00%)@@ master #13244 diff @@
==========================================
Files 138 143 +5
Lines 51126 71578 +20452
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43122 62866 +19744
- Misses 8004 8712 +708
Partials 0 0
|
All gbq tests passed locally
|
@parthea thanks for testing! |
Currently the
to_gbq
method fails whenverbose=False
, as the printing of progress is done regardless of the value of theverbose
flag, and thereforetotal_rows
gets called without being set. This change suppresses printing of progress whenverbose=False
.