celery / kombu

Messaging library for Python.
http://kombu.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
2.81k stars 920 forks source link

Azure servicebus transport has hidden dependency on azure-identity package #2045

Open Korijn opened 5 days ago

Korijn commented 5 days ago

The azure-servicebus transport depends on azure-identity package, even though it is not listed:

https://github.com/celery/kombu/blob/d620132ecee40fc021f7a78750dfe01331e8a8c0/requirements/extras/azureservicebus.txt#L1

It looks like the code intends for it to be optional:

https://github.com/celery/kombu/blob/d620132ecee40fc021f7a78750dfe01331e8a8c0/kombu/transport/azureservicebus.py#L72-L77

But of course it crashes here when (effectively) calling isinstance(..., None)

https://github.com/celery/kombu/blob/d620132ecee40fc021f7a78750dfe01331e8a8c0/kombu/transport/azureservicebus.py#L140-L146

File "/app/.venv/lib/python3.9/site-packages/kombu/transport/azureservicebus.py", line 144, in _try_parse_connection_string
    if (isinstance(self._credential, DefaultAzureCredential) or
TypeError: isinstance() arg 2 must be a type or tuple of types

This problem was introduced in #1641

Nusnus commented 2 days ago

This problem was introduced in #1641

@jasonwbarnett hey friend - can you check this out please?