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

Allow disabling periodic committing when inserting rows with DbApiHook #1207

Merged
merged 2 commits into from
Apr 13, 2016

Conversation

underyx
Copy link
Contributor

@underyx underyx commented Mar 24, 2016

>>> i = 1
>>> commit_every = 0
>>> bool(i % commit_every == 0)  # previously
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
>>> bool(commit_every and i % commit_every == 0)  # with this change
False

```
>>> i = 1
>>> commit_every = 0
>>> bool(i % commit_every == 0)  # previously
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
>>> bool(commit_every and i % commit_every == 0)  # with this change
False
```
@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 7a31361 on underyx:patch-1 into 58df89f on airbnb:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 66.377% when pulling 7a31361 on underyx:patch-1 into 58df89f on airbnb:master.

@mistercrunch
Copy link
Member

It would be nice if you added a definition of the parameters in the docstring, their expected types and special cases (like handling of 0) you just added. There are examples in the codebase as to what the param should be for the auto-docs to format it nicely. Are you up for it?

@underyx
Copy link
Contributor Author

underyx commented Mar 29, 2016

Yeah, why not, @mistercrunch. I'll do it later today, hopefully.

@underyx
Copy link
Contributor Author

underyx commented Apr 13, 2016

@mistercrunch well I guess I didn't do it 'later that day' in the end. PR might be ready to merge now, though!

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling b940706 on underyx:patch-1 into 58df89f on airbnb:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.6%) to 67.998% when pulling b940706 on underyx:patch-1 into 58df89f on airbnb:master.

@r39132
Copy link
Contributor

r39132 commented Apr 13, 2016

@underyx Please squash commits and ping me on gitter when ready to merge again

@r39132 r39132 merged commit 5d15d68 into apache:master Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants