chitralverma commented on code in PR #7869:
URL: https://github.com/apache/opendal/pull/7869#discussion_r3533866033
##########
bindings/python/python/opendal/operator.pyi:
##########
@@ -161,6 +161,35 @@ class AsyncOperator:
coroutine
An awaitable that returns True if the path exists, False otherwise.
"""
+ @classmethod
+ def from_uri(cls, /, uri: str, **kwargs) -> AsyncOperator:
+ """
+ Create a new `AsyncOperator` from a URI string.
+
+ The URI encodes the scheme and configuration in a single string, e.g.
+ ``memory://`` or ``s3://bucket/path?region=us-east-1``. The scheme must
+ belong to a service enabled in this build.
+
+ Parameters
+ ----------
+ uri : str
+ The URI of the service.
+ **kwargs : dict
+ Extra options that override or supplement values encoded in the
URI.
+
+ Returns
+ -------
+ AsyncOperator
+ The new async operator.
+
+ Examples
+ --------
+ >>> import opendal
+ >>> op = opendal.AsyncOperator.from_uri("memory://")
+ >>> op = opendal.AsyncOperator.from_uri(
+ ... "s3://bucket/path", region="us-east-1"
Review Comment:
added example for this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]