This problem refers to #444
I am working with smart_open for Azure blob storage, but I'm working on a codebase that uses the older API interface by azure i.e. v2.1 which provides BlockBlobService. I see in the client this accepts BlobServiceClient. Could it be used with BlockBlobService?
Talking about this version here.
In the current code if I try to use v2.1 client like
from azure.storage.blob import BlockBlobService
from smart_open import open as sopen
client = BlockBlobService(account_name='account-name', account_key='secret-key')
sopen('azure://{0}/{1}'.format("container", "file"), 'wb', transport_params=dict(client=client))
I get an error:
AttributeError: 'BlockBlobService' object has no attribute 'get_container_client'
which hints over API differences in v2.1 and v12.0
Would we implement smart_open for azure v2.1 python-sdk too? If yes, would like to contribute.
Why would we want to support a much older version of the API? Is it somehow more popular or commonly used?
As a maintainer, I would prefer to avoid it.
the 2.1 and 12.0 versions don't play well with each other at all. I recently moved some of my other code to 12.0 I would suggest getting there as soon as possible.
Can we please change the title to "Support for v2.1 of Azure python sdk"?
I agree with the comments above. I do not think we should add backwards compatibility for a depreciated SDK. Seems like if @prakharcode needs this he should fork and build it himself with the expectation that this will not be merged upstream.
Yes, I'm implementing a version for v2.1 myself, v2.1 SDK was implemented earlier in my project and according to Microsoft's package timeline BlockBlobService interface was deprecated in May 2020 only, while v2.1 was deprecated in Oct'19 (here). Hence there might be some project with v2.1 implementation.
Most helpful comment
I agree with the comments above. I do not think we should add backwards compatibility for a depreciated SDK. Seems like if @prakharcode needs this he should fork and build it himself with the expectation that this will not be merged upstream.