Open hagenw opened 2 months ago
their might be backends, where we don't can provide a meaningful URL/root path
Yes, that's why we removed Backend.path
in https://github.com/audeering/audbackend/pull/47.
Probably the simplest solution would be to add an optional return argument to Backend.put_file()
. Backends like FileSystem
and Artifactory
can use it to return the path on the backend. But other backends, like the SQL backend in the documentation, may also return None
.
The other, more complex solution I see, is that we add a method to Backend
and Interface
that translates a virtual backend path to its "real" path. But again the return value can be None
as it may not make sense on all backends.
In some packages we provided a method to get the actual path of a file on the backend, which might be useful to navigate to the file or download it directly, e.g.
audmodel.url()
.For the two backends we have at the moment, this can be achieved with (when using an interface that versions files):
FileSystem
:interface.join(interface.backend._root, interface._path_with_version(path, version))
Artifactory
:str(interface.backend.path(interface._path_with_version(path, version)))
This has a few problems though: