question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for v2.1 of Azure python sdk

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
petedannemanncommented, Jun 15, 2020

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.

2reactions
adclosecommented, Jun 15, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

which SDK is better to use for azure: blobs with Python v2.1 ...
Though not recommended but the only reason one would want to use version 2.1 of the SDK if there's a need to have...
Read more >
Azure Machine Learning CLI & Python SDK (v2)
SDK v2 allows you to build a single command or a chain of commands like Python functions - the command has a name,...
Read more >
Use the Azure libraries (SDK) for Python | Microsoft Learn
The Azure libraries are how you communicate with Azure services from Python code that you run either locally or in the cloud. (Whether...
Read more >
Azure ML Package client library for Python | Microsoft Learn
Python SDK v2 allows you to move from simple to complex tasks easily and incrementally. This is enabled by using a common object...
Read more >
Tutorial: ML pipelines with Python SDK v2 - Azure
The Azure ML framework can be used from CLI, Python SDK, or studio interface. In this example, you'll use the AzureML Python SDK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found