feat(bindings/python): Enhance Reader and Writer#6086
Conversation
Hi, I think the additional options for |
85446eb to
e532bbf
Compare
erickguan
left a comment
There was a problem hiding this comment.
Great feature and nice chore work!
I added a few suggestions.
|
added a temp fix for the breaking tests. |
erickguan
left a comment
There was a problem hiding this comment.
Minor comments on test exceptions.
LGTM
bindings/python/tests/test_write.py
Outdated
| with pytest.raises(Exception)as excinfo: | ||
| async with await async_operator.open(filename, "wb", if_not_exists=True) as w: | ||
| w.write(content) | ||
| assert "ConditionNotMatch" in str(excinfo.value) |
There was a problem hiding this comment.
minor: blank around the keyword as.
Perhaps you can import ConditionNotMatch which aligns with other code. Then:
| with pytest.raises(Exception)as excinfo: | |
| async with await async_operator.open(filename, "wb", if_not_exists=True) as w: | |
| w.write(content) | |
| assert "ConditionNotMatch" in str(excinfo.value) | |
| with pytest.raises(ConditionNotMatch): | |
| async with await async_operator.open(filename, "wb", if_not_exists=True) as w: | |
| w.write(content) |
There was a problem hiding this comment.
@erickguan this is what i did before, but there was a different issue.
I'll address that in a separate PR.
There was a problem hiding this comment.
@chitralverma Thank you so much for bringing up the issue, investigation, and fix! You can add a TODO or a link to the GitHub issue. I will not make this comment in that case :)
bindings/python/tests/test_write.py
Outdated
| with pytest.raises(Exception)as excinfo: | ||
| with operator.open(filename, "wb", if_not_exists=True) as w: | ||
| w.write(content) | ||
| assert "ConditionNotMatch" in str(excinfo.value) |
There was a problem hiding this comment.
| with pytest.raises(Exception)as excinfo: | |
| with operator.open(filename, "wb", if_not_exists=True) as w: | |
| w.write(content) | |
| assert "ConditionNotMatch" in str(excinfo.value) | |
| with pytest.raises(ConditionNotMatch): | |
| with operator.open(filename, "wb", if_not_exists=True) as w: | |
| w.write(content) |
There was a problem hiding this comment.
@erickguan this is what i did before, but there was a different issue.
I'll address that in a separate PR.
related discussion: #6235
|
@Xuanwo @erickguan all your suggestions have been included now, and I've updated the description for this PR. |
|
Thank you @chitralverma for working on this. Although we haven't addressed #6235 yet, I think it's fine to use a workaround in the tests for now. Will merge after CI passed. |
Which issue does this PR close?
Closes #5943
What changes are included in this PR?
open(...)read(...)write(...)Are there any user-facing changes?
No breaking changes, but users can use the new features.