-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
ServiceBus dict-representation acceptance and kwarg-update functionality #14807
ServiceBus dict-representation acceptance and kwarg-update functionality #14807
Conversation
…ient methods now accept dict-representation
Thank you for your contribution bradleydamato! We will review the pull request and get back to you soon. |
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_sender.py
Outdated
Show resolved
Hide resolved
Hey @bradleydamato , thanks again for all your work on this, very appreciated to save us the effort! Left some comments, don't hesitate to ping back if any questions on them or broader clarity needed. As an FYI, the conflicts that popped up are hopefully minimal (due to an refactor on the core surface area motivated by architect asks, and likely only intersects very tangentially with what you're doing) but as above shout if I can lend hands with anything, since that's "on us" for pushing in the broad changes before getting to these smaller PRs, and I'd like to not make life TOO much harder on you as a result of that choice :) |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
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
@annatisch
do you think this feature would be worth a minor version bump to 7.1.0?
I know Swathi had a discussion with you that we don't want to encourage people to use dict and we're not gonna explicitly mention it so I'm thinking of just do a 7.0.2 release as there're no explicit API changes we want to mention.
sdk/servicebus/azure-servicebus/azure/servicebus/_common/utils.py
Outdated
Show resolved
Hide resolved
self._check_live() | ||
messages = create_messages_from_dicts_if_needed(messages, ServiceBusMessage) # type: ignore |
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.
Why did typing need to be ignored here, but not line 315?
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.
It results in the following mypy error:
Incompatible types in assignment (expression has type "Union[ServiceBusMessage, List[ServiceBusMessage], ServiceBusMessageBatch]", variable has type "Union[ServiceBusMessage, List[ServiceBusMessage]]")
.
Since schedule_messages
doesn't accept SBMessageBatch, reassigning messages
to the result of create_messages_from_dicts_if_needed
(which accepts all 3) leads to this error. send_messages
doesn't do this because it accepts all 3, so reassigning message
doesn't lead to incompatible types.
sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py
Outdated
Show resolved
Hide resolved
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Co-authored-by: Adam Ling (MSFT) <adam_ling@outlook.com>
…ps://github.com/bradleydamato/azure-sdk-for-python into ServiceBus_dict-representation_and_kwarg_update
hey @swathipil , we also need to update version number in the _version.py to 7.1.0, otherwise the CI would report error. |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
…into add_sample_check * 'master' of https://github.com/Azure/azure-sdk-for-python: (388 commits) [text analytics] add normalized_text (#17074) Renaming with_token identity function (#17066) Adapt to azure core's cloud event (#17063) align perf tests with js (#17069) [Perfstress][Storage] Added FileShare perf tests (#15834) [formrecognizer] Adding custom forms perf test (#16969) Fix LanguageShort typo (#17068) sas creds updates (#17065) [eventgrid] Fix Sample eh (#17064) [Perfstress][Storage] Added Datalake perf tests (#15861) [text analytics] Healthcare n-ary relations (#16997) ServiceBus dict-representation acceptance and kwarg-update functionality (#14807) [text analytics] add perf tests (#17060) Add cloud event to core (#16800) [Perf] Small fixes to storage-blob (#17055) [EG] Regenerate Code (#17053) Scrub batch shared keys (#17030) [Tables] Add SAS to tables (#16717) T2 containerservice 2021 03 03 (#17050) Addressing issues with CredScan (#16944) ...
…into add_query_kwarg * 'master' of https://github.com/Azure/azure-sdk-for-python: (69 commits) march release (Azure#16966) Release of Device Update for IoT Hub SDK for Python. (Azure#17005) Add Get-AllPackageInfoFromRepo (Azure#16947) Track1 package is incorrectly set as track2 (Azure#17075) [text analytics] add normalized_text (Azure#17074) Renaming with_token identity function (Azure#17066) Adapt to azure core's cloud event (Azure#17063) align perf tests with js (Azure#17069) [Perfstress][Storage] Added FileShare perf tests (Azure#15834) [formrecognizer] Adding custom forms perf test (Azure#16969) Fix LanguageShort typo (Azure#17068) sas creds updates (Azure#17065) [eventgrid] Fix Sample eh (Azure#17064) [Perfstress][Storage] Added Datalake perf tests (Azure#15861) [text analytics] Healthcare n-ary relations (Azure#16997) ServiceBus dict-representation acceptance and kwarg-update functionality (Azure#14807) [text analytics] add perf tests (Azure#17060) Add cloud event to core (Azure#16800) [Perf] Small fixes to storage-blob (Azure#17055) [EG] Regenerate Code (Azure#17053) ...
…into add_reprs * 'master' of https://github.com/Azure/azure-sdk-for-python: (71 commits) EG - more docs imrpovement (Azure#17079) [EventHubs] add logging.info to warn the usage of partition key of non-string type (Azure#17057) march release (Azure#16966) Release of Device Update for IoT Hub SDK for Python. (Azure#17005) Add Get-AllPackageInfoFromRepo (Azure#16947) Track1 package is incorrectly set as track2 (Azure#17075) [text analytics] add normalized_text (Azure#17074) Renaming with_token identity function (Azure#17066) Adapt to azure core's cloud event (Azure#17063) align perf tests with js (Azure#17069) [Perfstress][Storage] Added FileShare perf tests (Azure#15834) [formrecognizer] Adding custom forms perf test (Azure#16969) Fix LanguageShort typo (Azure#17068) sas creds updates (Azure#17065) [eventgrid] Fix Sample eh (Azure#17064) [Perfstress][Storage] Added Datalake perf tests (Azure#15861) [text analytics] Healthcare n-ary relations (Azure#16997) ServiceBus dict-representation acceptance and kwarg-update functionality (Azure#14807) [text analytics] add perf tests (Azure#17060) Add cloud event to core (Azure#16800) ...
…into http_response_json * 'master' of https://github.com/Azure/azure-sdk-for-python: (165 commits) EG - more docs imrpovement (Azure#17079) [EventHubs] add logging.info to warn the usage of partition key of non-string type (Azure#17057) march release (Azure#16966) Release of Device Update for IoT Hub SDK for Python. (Azure#17005) Add Get-AllPackageInfoFromRepo (Azure#16947) Track1 package is incorrectly set as track2 (Azure#17075) [text analytics] add normalized_text (Azure#17074) Renaming with_token identity function (Azure#17066) Adapt to azure core's cloud event (Azure#17063) align perf tests with js (Azure#17069) [Perfstress][Storage] Added FileShare perf tests (Azure#15834) [formrecognizer] Adding custom forms perf test (Azure#16969) Fix LanguageShort typo (Azure#17068) sas creds updates (Azure#17065) [eventgrid] Fix Sample eh (Azure#17064) [Perfstress][Storage] Added Datalake perf tests (Azure#15861) [text analytics] Healthcare n-ary relations (Azure#16997) ServiceBus dict-representation acceptance and kwarg-update functionality (Azure#14807) [text analytics] add perf tests (Azure#17060) Add cloud event to core (Azure#16800) ...
addressing issue: #14335