-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Azure Storage Blob #444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add more unit tests with the seek function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a detailed review and left you some comments. Please have a look.
The CI builds are now passing correctly |
Do we want integration tests for this? Additionally can we update the README examples and credentials sections so people can understand how to use this plugin? |
Yes and yes, please. |
@petedannemann Ping on integration tests. How's it coming along? |
I have a branch with some progress. How do you suggest we get my changes into this PR? I cannot open another PR on @nclsmitchell's branch |
@petedannemann I think the easiest way to proceed is to merge this, and then open a new PR with the integration tests. This looks like it's ready to merge, right? |
@nclsmitchell did you ever perform any functional tests? I can't get this to work due to |
There are seven different ways to authenticate to ASB with Python. They all require different configuration and they all have to be used explicitly. I think we should refactor this such that |
Wait, how did the CI tests pass then? |
@piskvorky the CI only runs mocked unit tests for ASB. This PR's mock for |
OK. I assume @nclsmitchell was scratching his own itch. It's weird the PR would not work beyond mock tests. |
The PR does work, just the |
@nclsmitchell it also appears that containers are optional and that blobs can be written / read from the root container. Currently this fails if the container is omitted. I think we will want to accommodate for this. |
Merged. @petedannemann Please go ahead with your improvements. @nclsmitchell Thank you for your contribution! |
Hi I can see this is merged and I have installed with import os
from smart_open import open
from azure.storage.blob import BlobServiceClient
azure_storage_connection_string = os.environ.get('AZURE_STORAGE_CONNECTION_STRING', "")
client = BlobServiceClient.from_connection_string(azure_storage_connection_string)
fin = open('azure://my_container/my_blob.txt', transport_params=dict(client=client)) I'm getting NotImplementedError: Unable to handle scheme 'azure', expected one of ('', 'asb', 'file', 'hdfs', 'http', 'https', 's3', 's3a', 's3n', 's3u', 'scp', 'sftp', 'ssh', 'webhdfs'). Extra dependencies required by 'azure' may be missing. See <https://github.com/RaRe-Technologies/smart_open/blob/master/README.rst> for details. I went into site-packages to confirm if the right branch with the right changes is picked up and the package is exactly the same as the What am I doing wrong here? |
oh got it, in the error, it specifies to use |
@prakharcode please refer to #501 for discussion on the naming of the Azure Blob Storage integration |
@petedannemann Hi, I am working with this, but I'm working on a codebase that uses the older API interface by azure i.e. v1.2 which provides Talking about this here. |
@prakharcode this PR really isn't the appropriate place to discuss this. Please open an issue where it can be seen and easily searched for by other smart-open users |
Support Azure Storage Blob
Motivation
Support of reading and writing blobs with Azure Storage Blob.
If you're adding a new feature, then consider opening a ticket and discussing it with the maintainers before you actually do the hard work.
Tests
If you're fixing a bug, consider test-driven development:
If you're implementing a new feature, include unit tests for it.
Make sure all existing unit tests pass.
You can run them locally using:
If there are any failures, please fix them before creating the PR (or mark it as WIP, see below).
Work in progress
If you're still working on your PR, include "WIP" in the title.
We'll skip reviewing it for the time being.
Once you're ready to review, remove the "WIP" from the title, and ping one of the maintainers (e.g. mpenkov).
Checklist
Before you create the PR, please make sure you have:
Workflow
Please avoid rebasing and force-pushing to the branch of the PR once a review is in progress.
Rebasing can make your commits look a bit cleaner, but it also makes life more difficult from the reviewer, because they are no longer able to distinguish between code that has already been reviewed, and unreviewed code.