Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
338 stars 240 forks source link

azure-storage-blob 12.0.0 #640

Open jialutu opened 4 years ago

jialutu commented 4 years ago

Which service(blob, file, queue) does this issue concern?

Blob

Which version of the SDK was used? Please provide the output of pip freeze.

azure-storage-blob 12.0.0

What problem was encountered?

cannot import name 'BlockBlobService' from 'azure.storage.blob'

Have you found a mitigation/solution?

Revert back to v2.1.0

I just want to add that in pypi the documentation mentions to use from azure.storage.blob import BlobServiceClient. However the documentation found in https://azure-storage.readthedocs.io/index.html still mentions using BlockBlobService instead. So can I clarify which package are we expected to import going forward?

akx commented 4 years ago

azure-storage-blob 12.x is being developed over at https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-blob , it seems.

The PyPI metadata hasn't been updated to reflect this though.

xiafu-msft commented 4 years ago

Hi @jialutu Thanks for reaching out! The pypi says the correct thing, you should import BlobServiceClient if you plan to use azure-storage-blob version 12.0.0

Here is the doc for reference. https://azuresdkdocs.blob.core.windows.net/$web/python/azure-storage-blob/12.0.0b5/index.html

The doc you were looking at is for version 2.0.0. Let me know if you need other help!

zezha-msft commented 4 years ago

Thanks @akx for the heads-up!

@xiafu-msft It appears that the project home link should be updated.

xiafu-msft commented 4 years ago

Sure, the pr is there, https://github.com/Azure/azure-sdk-for-python/pull/8358 probably it will not be in prod until next release?

jialutu commented 4 years ago

I have to say though this is quite disappointing in that there has been no deprecation warnings for the BlockBlobService, where a new version has been released getting rid BlockBlobService entirely, which we rely on for our production services. If this is the case going forward for Azure python libraries, I am starting to question our long term strategy of using Azure.

akx commented 4 years ago

I have to say though this is quite disappointing in that there has been no deprecation warnings for the BlockBlobService, where a new version has been released getting rid BlockBlobService entirely, which we rely on for our production services.

This was a very major version bump (azure-storage-blob==2.1.0 -> azure-storage-blob==12.0.0) – I don't know if Azure SDKs follow Semver, but if they do, that alone should be a big ol' warning sign that APIs will have changed.

In my opinion, you should not be running production services without having pinned/locked your dependencies in a way that ensures you can test that exactly the versions of all dependencies you install have a fighting chance to work in your production environment, too. My tool of choice for pinning Python dependencies is pip-tools.

akshitjain commented 4 years ago

@jialutu @xiafu-msft @zezha-msft . I am also facing similar issue. This is very strange. There should be some kind of backward compatibility.I have many services running on production and all are impacted. Such drastic changes are worry-some and making me reconsider azure as cloud provider. We understand azure is in development phase but you have to give backward compatibility otherwise people will prefer AWS at-least they are stable and don't make drastic changes in their sdk's.

zezha-msft commented 4 years ago

Hi @jialutu @akshitjain, thanks for sharing your concerns, and sorry for the inconvenience.

To clarify, the SDK follows semantic versioning, and all major version updates are breaking by definition. As @akx has pointed out, it is best practice to pin to a specific version for your dependencies that you have tested with, to avoid having a brittle production environment.

All the Storage SDKs were re-designed in version 12.0.0 and provide better usability. The official announcement will come soon.

zezha-msft commented 4 years ago

FYI @jialutu the Pypi page has links to the samples and reference docs.

timuralp commented 4 years ago

@zezha-msft please update the project homepage link on PyPI. It currently links here, however, it should point to https://github.com/Azure/azure-sdk-for-python (or, as the source code link does, to: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-blob/azure/storage/blob). It's confusing that the project has been re-parented, but this repository continues to exist.

taymonbeal commented 4 years ago

Hi, is the official announcement still in the works? This change broke my project and it'd be useful to have a bit of context as to what's going on.