Skip to content

feat(binding/python): allow setting append/buffer/more in write() call#3256

Merged
Xuanwo merged 11 commits intoapache:mainfrom
jokester:python-binding-expose-more
Oct 12, 2023
Merged

feat(binding/python): allow setting append/buffer/more in write() call#3256
Xuanwo merged 11 commits intoapache:mainfrom
jokester:python-binding-expose-more

Conversation

@jokester
Copy link
Copy Markdown
Contributor

Fixes #3242

This PR adds named parameters to python Operator.write() AsyncOperator.write() methods, to allow append/buffer/content_type/more to be set.

@github-actions github-actions Bot added the releases-note/feat The PR implements a new feature or has a title that begins with "feat" label Oct 10, 2023
@jokester jokester force-pushed the python-binding-expose-more branch from f1cc133 to 17f4ce5 Compare October 10, 2023 14:45
@jokester jokester marked this pull request as ready for review October 10, 2023 14:45
@jokester jokester requested a review from messense as a code owner October 10, 2023 14:45
Comment thread bindings/python/python/opendal/__init__.pyi Outdated
Comment thread bindings/python/src/asyncio.rs Outdated
Copy link
Copy Markdown
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format the .pyi file with black.

Comment thread bindings/python/src/lib.rs Outdated
Comment thread bindings/python/tests/test_services.py Outdated
Comment thread bindings/python/python/opendal/__init__.pyi
Comment thread bindings/python/src/lib.rs
@jokester jokester requested review from Xuanwo and messense October 12, 2023 03:55
@Xuanwo
Copy link
Copy Markdown
Member

Xuanwo commented Oct 12, 2023

This PR mostly LGTM. Needs @messense to confirm the pyi changes.

Copy link
Copy Markdown
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Comment thread bindings/python/python/opendal/__init__.pyi
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@Xuanwo Xuanwo merged commit 044cf64 into apache:main Oct 12, 2023
@jokester jokester deleted the python-binding-expose-more branch October 12, 2023 08:36
Zheaoli pushed a commit to Zheaoli/opendal that referenced this pull request Oct 12, 2023
apache#3256)

* binding/python: add new parameters to stub methods

* add parameters to implementations

* run cargo fmt

* make clippy happy

* run black on py stubs

* Operator: read and apply kwargs in PyDict

* refactor kwargs recognition to struct WriteOptions

* touch test to see if WriteOptions worked

* Revert "touch test to see if WriteOptions worked"

This reverts commit bb38127.

* remove WriteOptions and reuse od::OpWrite

* rewrite build_opwrite()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Capability to set contentType not available in python binding

3 participants