-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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&EventHubs] api fixes #22418
[ServiceBus&EventHubs] api fixes #22418
Conversation
sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_client.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_client_async.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_client_async.py
Outdated
Show resolved
Hide resolved
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py
Outdated
Show resolved
Hide resolved
@@ -5,6 +5,7 @@ | |||
from typing import Any, Union, Optional, TYPE_CHECKING | |||
import logging | |||
from weakref import WeakSet | |||
from typing_extensions import Literal |
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.
As you mentioned in a comment elsewhere - I think this will need to be:
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
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.
this causes a mypy error, same as this one: python/typeshed#3500
They mention checking python version as the solution. I'm not sure if that's what we want to do? or if we should leave this as is here since this works, though not ideal.
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.
If we add the setup.py amendment above (which we probably should - we don't want unnecessary dependencies) then typing_extensions wont be available in <3.8.
As linked to within the issue you linked to - Mypy should support/understand Python version checks.
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.
sounds good, thank you!
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 looks like there's still an issue with mypy, but I think this is because this mypy check in the pipeline is using Python 3.7.
I can ask Scott about this.
@@ -683,6 +685,8 @@ def receive_deferred_messages( | |||
:caption: Receive deferred messages from ServiceBus. | |||
|
|||
""" | |||
if kwargs: | |||
warnings.warn(f"Unsupported keyword args: {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.
Is the f {}
formatting support in 3.6+?
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.
yes it is
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
* api updates * fix mypy 3.7 errors * Annas comments * mypy literal variable error * lint * update type hint session_id * docstring * lint * add SBSessionFilter to public API * add typing_extensions to setup.py/add back kwargs with warnings * add kwargs + warn to amqp message * typing-extensions add to shared reqs * lint * add bool to body ED type * anna + adam comments * move to extras require * add back to install reqs
Release apimangement 2022-08 01 (Azure#22313) * Release api management 2022 08 01 (Azure#21169) * add base for 2022-08-01 * updates readme.md * update api-version and examples * resolve Go SDK breaking change * update examples to fix model definition Co-authored-by: Chenjie Shi <tadelesh.shi@live.cn> * Adding Resolver Entities to documentation (Azure#21352) * merging in resolver entities * adding resolver updates * fixed policy examples that were missing a policyId param * fixed typo that added a nested properties prop * fixed description for API Resolvers List, filter query * fixed error in definitions for resolvers * fixed example that had an incorrect response definition * added missing json file references * fix for linting errors * ref fixes and undoing bad merge overwrites * fix typo * wiki for apis and products (Azure#21595) * wiki for apis and products * prettier; fixed spellchecks * Fixed spelling * Updated path Co-authored-by: changlong-liu <59815250+changlong-liu@users.noreply.github.com> * code review changes; gihub checks fixes * fixed conact name and paths * added properties back * added contract properties objects * fixed lint * changed example to match the definition * prettier * code review changes * added paths and examples for wiki collections * Added x-ms-pageable * removed count Co-authored-by: changlong-liu <59815250+changlong-liu@users.noreply.github.com> * Add ConfirmConsentCode to APIM RP (Azure#22418) * Update apimauthorizationproviders.json Add ConfirmConsentCode endpoint * Update definitions.json * Create ApiManagementPostAuthorizationConfirmConsentCodeRequest.json * Update definitions.json Remove count property * Update apimauthorizationproviders.json * [2022-08-01] Fix Linter Errors (Azure#22537) * linter errors * prettier * v2 * fix error response duplicate schema * type object * prettier * sync data from current ga version * remove duplicate parameter * type object --------- Co-authored-by: Chenjie Shi <tadelesh.shi@live.cn> Co-authored-by: hoonality <92482069+hoonality@users.noreply.github.com> Co-authored-by: malincrist <92857141+malincrist@users.noreply.github.com> Co-authored-by: changlong-liu <59815250+changlong-liu@users.noreply.github.com> Co-authored-by: Logan Zipkes <44794089+LFZ96@users.noreply.github.com>
updated the following, after API review:
EH:
EventData.body
to type primitives (not Any): None/bool/int/float/bytes/str/dict/list/uuid.UUIDSB:
2) update type of kwarg
session_id
in sync/asyncServiceBusClient.get_queue_receiver/get_subscription_receiver
toUnion[str, Literal[NEXT_AVAILABLE_SESSION]]
3) update return type of async/sync
ServiceBusSession.get_state()
tobytes
4) move docstring type of kwarg
sub_queue
to:paramtype
line in async/syncServiceBusClient.get_queue_receiver