This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 tasks
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
I'd expect to get this error sooner but that's probably for another PR (I've created an issue for it): ValueError: Connection string is either blank or malformed. from prefect_azure import AzureBlobStorageCredentials
from prefect_azure.blob_storage import AzureBlobStorageContainer
my_connection_string = "dsfdsf" # fake
credentials = AzureBlobStorageCredentials(
connection_string=my_connection_string,
)
container = AzureBlobStorageContainer(
container_name="testing314", # container exists
credentials=credentials,
)
# Downloads all files from the specified folder
container.download_folder_to_path(
from_folder="requirements.txt",
to_folder="local_folder"
) 12:48:34.514 | INFO | prefect.AzureBlobStorageContainer - Downloading folder from container testing314 to path local_folder
Traceback (most recent call last):
File "/Users/bean/code-oss/prefect-azure/prefect_azure/credentials.py", line 65, in inner
return func(*args, **kwargs)
File "/Users/bean/code-oss/prefect-azure/prefect_azure/credentials.py", line 259, in get_container_client
container_client = ContainerClient.from_connection_string(
File "/Users/bean/code-oss/prefect-azure/azurevenv/lib/python3.10/site-packages/azure/storage/blob/_container_client.py", line 270, in from_connection_string
account_url, secondary, credential = parse_connection_str(conn_str, credential, 'blob')
File "/Users/bean/code-oss/prefect-azure/azurevenv/lib/python3.10/site-packages/azure/storage/blob/_shared/base_client.py", line 371, in parse_connection_str
raise ValueError("Connection string is either blank or malformed.")
ValueError: Connection string is either blank or malformed.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/bean/code-oss/prefect-azure/qa.py", line 14, in <module>
container.download_folder_to_path(
File "/Users/bean/code-oss/prefect-azure/azurevenv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 259, in coroutine_wrapper
return call()
File "/Users/bean/code-oss/prefect-azure/azurevenv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 431, in __call__
return self.result()
File "/Users/bean/code-oss/prefect-azure/azurevenv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 317, in result
return self.future.result(timeout=timeout)
File "/Users/bean/code-oss/prefect-azure/azurevenv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 178, in result
return self.__get_result()
File "/Users/bean/.pyenv/versions/3.10.4/lib/python3.10/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/Users/bean/code-oss/prefect-azure/azurevenv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 388, in _run_async
result = await coro
File "/Users/bean/code-oss/prefect-azure/prefect_azure/blob_storage.py", line 283, in download_folder_to_path
async with self.credentials.get_container_client(
File "/Users/bean/code-oss/prefect-azure/prefect_azure/credentials.py", line 72, in inner
raise ValueError(HELP_FMT.format(help_url=HELP_URLS[key])) from exc
ValueError: Please visit https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python#copy-your-credentials-from-the-azure-portal for retrieving the proper connection string. |
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
reviewed
Mar 14, 2024
serinamarie
approved these changes
Mar 14, 2024
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.
LGTM! 🔥
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an
AzureBlobStorageContainer
block as a replacement for theAzure
block in the core library. Works for both deployment flow code storage and result storage.Closes #135
Example
Screenshots
Checklist
pre-commit
checks.pre-commit install && pre-commit run --all
locally for formatting and linting.mkdocs serve
view documentation locally.