[Service Bus] Enable pylint and mypy#11316
Conversation
|
/azp run python - servicebus - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_message.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_message.py
Outdated
Show resolved
Hide resolved
|
|
||
| """ | ||
| return super(ServiceBusSessionReceiver, cls).from_connection_string(conn_str, **kwargs) | ||
| constructor_args = super(ServiceBusSessionReceiver, cls)._from_connection_string(conn_str, **kwargs) |
There was a problem hiding this comment.
I believe it would have done the right behavior even in the single-call form, since it was using "cls" to initialize the object regardless; but if we want to decouple it further, let's at least name this inner function (_from_connection_string) something more useful than just a magic hidden callable of the same structure. Perhaps "_get_constructor_args_from_connection_string" (Yes, verbose, but very clear ><)
There was a problem hiding this comment.
You're right. The single-call form is right. It's a false alarm of mypy. I'll change it back and suppress that mypy error. The original way is neat.
|
Azure Pipelines successfully started running 1 pipeline(s). |
helper _convert_connection_string_to_kwargs
| " the entity name in parameter is {}.".format(entity_in_conn_str, entity_in_kwargs) | ||
| ) | ||
|
|
||
| kwargs["fully_qualified_namespace"] = host |
There was a problem hiding this comment.
Last dumb nitpick: why not used a named tuple for this, if we're returning a structured and constrained set of values? (I've always had a dislike for arbitrary dicts because you get so little guidance on "what to expect/what's correct")
|
Azure Pipelines successfully started running 1 pipeline(s). |
…into feature/text_analytics_v3.0 * 'master' of https://github.com/Azure/azure-sdk-for-python: [text analytics] Update ta tests (#11461) Release azure mgmt hybridkubernetes (#11483) add ci to azure-mgmt-eventhub (#11459) [Service Bus] Enable pylint and mypy (#11316) update CODEOWNERS with smoke test owners (#11404) Sync eng/common directory with azure-sdk-tools repository (#11469)
Enable pylint and mypy check in CI and fix all errors reported by them.