clbarnes opened a new issue, #6984:
URL: https://github.com/apache/opendal/issues/6984
### Feature Description
I'm very excited by `Operator::from_uri` as it opens up a lot more options
for being generic over storage backends in many tools and bound languages.
Great job by everyone involved!
It would be very useful to be able to use this directly from e.g. python.
### Problem and Solution
Currently, if you're allowing a user to specify a storage backend, they need
to give the scheme and any operator-specific keyword arguments explicitly,
which makes for a broad API (see the many overloads of `Operator.__new__` in
python). Having an additional method which takes a URL and arbitrary keyword
arguments would open up a lot of flexibility, e.g.
```python
class Operator:
@staticmethod
def from_url(url: str, **kwargs) -> Self:
...
op_url = input("What is the URL of your operator? ")
operator = Operator.from_url(op_url)
```
rather than having to manually parse out the scheme and arguments from a URL
in order to use the existing `__new__` method(s).
I'm happy to give this a go if such a change would be accepted.
P.S. I've used URL because it is a locator rather than an identifier and
there's no mechanism for mapping a non-URL URI to a location; but we could
stick with URI for consistency.
### Additional Context
_No response_
### Are you willing to contribute to the development of this feature?
- [ ] Yes, I am willing to contribute to the development of this feature.
--
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]