Skip to content

Wrong type hint for azure.storage.queue.QueueClient.from_connection_string() -> None #11392

@ellieayla

Description

@ellieayla
  • Package Name: azure.storage.queue
  • Package Version: 12.1.1
  • Operating System: MacOS 10.15.4 (19E287)
  • Python Version: 3.8.2

Describe the bug

This code implies that azure.storage.queue.QueueClient.from_connection_string() returns None:

def from_connection_string(
cls, conn_str, # type: str
queue_name, # type: str
credential=None, # type: Any
**kwargs # type: Any
):
# type: (...) -> None

In contrast, azure.storage.blob.BlobClient.from_connection_string() returns a BlobClient.

def from_connection_string(
cls, conn_str, # type: str
container_name, # type: str
blob_name, # type: str
snapshot=None, # type: Optional[str]
credential=None, # type: Optional[Any]
**kwargs # type: Any
): # type: (...) -> BlobClient

To Reproduce
Steps to reproduce the behavior:

  1. In editor (eg PyCharm):
a = azure.storage.queue.QueueClient.from_connection_string()
a.<TAB>
  1. Observe unhelpful autocomplete.
  2. Add a comment # type: QueueClient
  3. Get useful autocomplete
  4. Now get Expected type 'QueueClient', got 'None' instead complaint.

Expected behavior
Correct type declaration of QueueClient. Or, at the very least, not an incorrect & affirmative declared type of None.

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions