Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address paul's comments
  • Loading branch information
swathipil committed Feb 21, 2024
commit 022da567036b0f5ef80cd6bfde79024ae475adbe
7 changes: 7 additions & 0 deletions sdk/core/corehttp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release History

## 1.0.0b3 (2024-02-01)

### Breaking Changes

- The `SansIOHTTPPolicy` and `HTTPPolicy` under `corehttp.runtime.policies` are now `typing.Protocols`. [#34296](https://github.com/Azure/azure-sdk-for-python/pull/34296)


## 1.0.0b3 (2024-02-01)

### Features Added
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/corehttp/corehttp/runtime/pipeline/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def __init__(
self._impl_policies.append(policy)
elif isinstance(policy, SansIOHTTPPolicy):
self._impl_policies.append(_SansIOHTTPPolicyRunner(policy))
elif policy:
self._impl_policies.append(policy)
else:
raise TypeError("Unsupported policy type: {}".format(type(policy)))
for index in range(len(self._impl_policies) - 1):
self._impl_policies[index].next = self._impl_policies[index + 1]
if self._impl_policies:
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/corehttp/corehttp/runtime/pipeline/_base_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def __init__(
self._impl_policies.append(policy)
elif isinstance(policy, SansIOHTTPPolicy):
self._impl_policies.append(_SansIOAsyncHTTPPolicyRunner(policy))
elif policy:
self._impl_policies.append(policy)
else:
raise TypeError("Unsupported policy type: {}".format(type(policy)))
for index in range(len(self._impl_policies) - 1):
self._impl_policies[index].next = self._impl_policies[index + 1]
if self._impl_policies:
Expand Down
3 changes: 3 additions & 0 deletions sdk/core/corehttp/corehttp/runtime/policies/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def send(self, request: PipelineRequest[HTTPRequestType]) -> PipelineResponse[HT
:return: The pipeline response object.
:rtype: ~corehttp.runtime.pipeline.PipelineResponse
"""
...


@runtime_checkable
Expand All @@ -82,6 +83,7 @@ def on_request(self, request: PipelineRequest[SansIOHTTPRequestType_contra]) ->
:param request: Request to be modified before sent from next policy.
:type request: ~corehttp.runtime.pipeline.PipelineRequest
"""
...

def on_response(
self,
Expand All @@ -95,6 +97,7 @@ def on_response(
:param response: Pipeline response object
:type response: ~corehttp.runtime.pipeline.PipelineResponse
"""
...


class RequestHistory(Generic[HTTPRequestType, HTTPResponseType]):
Expand Down
1 change: 1 addition & 0 deletions sdk/core/corehttp/corehttp/runtime/policies/_base_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ async def send(
:return: The pipeline response object.
:rtype: ~corehttp.runtime.pipeline.PipelineResponse
"""
...