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

feat(bindings/python): Enable BlockingLayer for non-blocking services that don't support blocking #3198

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

messense
Copy link
Member

Not sure why but it doesn't really work currently.

Python 3.11.0 (main, Oct 25 2022, 16:25:24) [Clang 14.0.0 (clang-1400.0.29.102)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.9.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import opendal

In [2]: op = opendal.Operator("s3", bucket="test", region="us-east-1")

In [3]: op.list("/")
---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
Cell In[3], line 1
----> 1 op.list("/")

Error: Unsupported (permanent) at blocking_list, context: { service: s3, path: / } => operation is not supported

@Xuanwo
Copy link
Member

Xuanwo commented Sep 28, 2023

Not sure why but it doesn't really work currently.

Seems it's not the latest code. I tested this PR locally with pyo3_runtime.PanicException error:

:) python
>>> import opendal
>>> op = opendal.Operator("s3", bucket="test", region="us-east-1")
thread '<unnamed>' panicked at 'blocking layer must be created: Unexpected (permanent) at  => failed to get current handle
', bindings/python/src/lib.rs:70:59
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pyo3_runtime.PanicException: blocking layer must be created: Unexpected (permanent) at  => failed to get current handle

@messense
Copy link
Member Author

That's odd, I've definitely rebased onto main before building... Anyway, it'd be nice to be able to use Operator with services that doesn't support blocking operations natively in Python.

@messense messense force-pushed the python-blocking-layer branch from 27f883a to 9141d57 Compare September 28, 2023 03:59
@messense messense changed the title feat(bindings/python): Enable BlockLayer for on-blocking services that don't support blocking feat(bindings/python): Enable BlockLayer for non-blocking services that don't support blocking Sep 28, 2023
@messense messense changed the title feat(bindings/python): Enable BlockLayer for non-blocking services that don't support blocking feat(bindings/python): Enable BlockingLayer for non-blocking services that don't support blocking Sep 28, 2023
@messense messense force-pushed the python-blocking-layer branch from 9141d57 to 81354a2 Compare September 28, 2023 04:01
Copy link
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!

@Xuanwo Xuanwo merged commit 838cea9 into apache:main Sep 28, 2023
@messense messense deleted the python-blocking-layer branch September 28, 2023 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants