-
Notifications
You must be signed in to change notification settings - Fork 3k
[Service Bus] Enable pylint and mypy #11316
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
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
@@ -134,7 +133,8 @@ def from_connection_string( | |||
:caption: Create a new instance of the ServiceBusReceiver from connection string. | |||
|
|||
""" | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.