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

make it possible to change # of retries #102

Merged
merged 1 commit into from Mar 24, 2017

Conversation

Projects
None yet
3 participants
@shaform
Contributor

shaform commented Dec 3, 2016

No description provided.

Show outdated Hide outdated smart_open/smart_open_lib.py Outdated
@tmylk

This comment has been minimized.

Show comment
Hide comment
@tmylk

tmylk Dec 4, 2016

Contributor

Thanks for the PR!
May I ask to add a test of this new feature, similar to https://github.com/RaRe-Technologies/smart_open/pull/96/files#diff-36c1f33ff2d12844dc387270ca11d040R694

Contributor

tmylk commented Dec 4, 2016

Thanks for the PR!
May I ask to add a test of this new feature, similar to https://github.com/RaRe-Technologies/smart_open/pull/96/files#diff-36c1f33ff2d12844dc387270ca11d040R694

@shaform

This comment has been minimized.

Show comment
Hide comment
@shaform

shaform Dec 4, 2016

Contributor

Thanks for the reply. I've added the test cases.

Contributor

shaform commented Dec 4, 2016

Thanks for the reply. I've added the test cases.

@shaform

This comment has been minimized.

Show comment
Hide comment
@shaform

shaform Dec 4, 2016

Contributor

It appears the test sometimes hangs (#62) possibly because mock_s3 does not go well with multiprocessing. So I've fixed it as well with a new commit.

Contributor

shaform commented Dec 4, 2016

It appears the test sometimes hangs (#62) possibly because mock_s3 does not go well with multiprocessing. So I've fixed it as well with a new commit.

@tmylk

This comment has been minimized.

Show comment
Hide comment
@tmylk

tmylk Dec 22, 2016

Contributor

@shaform Not sure about the last commit. It lowers our test coverage signifcantly. Will merge only the first one.

Contributor

tmylk commented Dec 22, 2016

@shaform Not sure about the last commit. It lowers our test coverage signifcantly. Will merge only the first one.

@shaform

This comment has been minimized.

Show comment
Hide comment
@shaform

shaform Dec 22, 2016

Contributor
Contributor

shaform commented Dec 22, 2016

@shaform

This comment has been minimized.

Show comment
Hide comment
@shaform

shaform Dec 22, 2016

Contributor

@tmylk All right, now I look at the code, I find that there are actually other places that have smart_open.smart_open("", 'wb') being tested. But then I couldn't find out why the coverage would be decreased. Could you share the coverage report?

Contributor

shaform commented Dec 22, 2016

@tmylk All right, now I look at the code, I find that there are actually other places that have smart_open.smart_open("", 'wb') being tested. But then I couldn't find out why the coverage would be decreased. Could you share the coverage report?

@shaform

This comment has been minimized.

Show comment
Hide comment
@shaform

shaform Mar 23, 2017

Contributor

@tmylk Ok. I've decided to revert the second commit. This makes the test more likely to fail due to #62 though.

Contributor

shaform commented Mar 23, 2017

@tmylk Ok. I've decided to revert the second commit. This makes the test more likely to fail due to #62 though.

Show outdated Hide outdated smart_open/smart_open_lib.py Outdated
@tmylk

This comment has been minimized.

Show comment
Hide comment
@tmylk

tmylk Mar 23, 2017

Contributor

Thanks. Just a decorative change requested.

Contributor

tmylk commented Mar 23, 2017

Thanks. Just a decorative change requested.

@tmylk tmylk merged commit 5c2e0a6 into RaRe-Technologies:master Mar 24, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tmylk

This comment has been minimized.

Show comment
Hide comment
@tmylk

tmylk Mar 24, 2017

Contributor

Apologies, didn't notice the discussion above. Thanks for this new feature!

Contributor

tmylk commented Mar 24, 2017

Apologies, didn't notice the discussion above. Thanks for this new feature!

IS_PY2 = (sys.version_info[0] == 2)
if IS_PY2:
import httplib
if sys.version_info[1] == 6:
import copy_reg

This comment has been minimized.

@piskvorky

piskvorky Mar 24, 2017

Member

@shaform What is this cleverness?

We try not to write code that is too clever, and if we must, we comment it heavily.

Please include detailed comments about the motivation and behaviour of these blocks of code.

@piskvorky

piskvorky Mar 24, 2017

Member

@shaform What is this cleverness?

We try not to write code that is too clever, and if we must, we comment it heavily.

Please include detailed comments about the motivation and behaviour of these blocks of code.

This comment has been minimized.

@shaform

shaform Mar 24, 2017

Contributor

@piskvorky
How about this: shaform@3154b06.

@shaform

shaform Mar 24, 2017

Contributor

@piskvorky
How about this: shaform@3154b06.

This comment has been minimized.

@piskvorky

piskvorky Mar 25, 2017

Member

Isn't it easier and more readable to just create a named function?

Named functions (at the module level) are pickleable without a problem. We don't have to monkey-patch pickling and use obscure functional currying.

I'm really -1 on this solution, unless there's a very good reason it cannot be done in a more straightforward manner.

@piskvorky

piskvorky Mar 25, 2017

Member

Isn't it easier and more readable to just create a named function?

Named functions (at the module level) are pickleable without a problem. We don't have to monkey-patch pickling and use obscure functional currying.

I'm really -1 on this solution, unless there's a very good reason it cannot be done in a more straightforward manner.

This comment has been minimized.

@shaform

shaform Mar 25, 2017

Contributor

@piskvorky @tmylk I've put the earlier implementation here https://github.com/shaform/smart_open/tree/retry_alt

I could send another pull request if you like.

@shaform

shaform Mar 25, 2017

Contributor

@piskvorky @tmylk I've put the earlier implementation here https://github.com/shaform/smart_open/tree/retry_alt

I could send another pull request if you like.

This comment has been minimized.

@tmylk

tmylk Mar 27, 2017

Contributor

Thanks @shaform. Simplified version merged in #118

@tmylk

tmylk Mar 27, 2017

Contributor

Thanks @shaform. Simplified version merged in #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment