Skip to content

Commit

Permalink
[EG] link + patch update (#36045)
Browse files Browse the repository at this point in the history
* update patch

* update date

* update link

* httpresponseerror

* update

* pylint

* pylint

* remove wrap
  • Loading branch information
l0lawrence authored Jun 12, 2024
1 parent 5b61bd4 commit 614a928
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sdk/eventgrid/azure-eventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 4.20.0 (2024-06-11)
## 4.20.0 (2024-06-12)

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ def _serialize_events(events):
# Try to serialize CNCF Cloud Events
return [_from_cncf_events(e) for e in events]
else:
# Does not conform to format
raise TypeError("Invalid event data. Please check the data is of Cloud Event type/format and try again.")
# Does not conform to format, try to send
return events


def _serialize_cloud_event(cloud_event):
Expand Down
4 changes: 2 additions & 2 deletions sdk/eventgrid/azure-eventgrid/migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ cloud_event = {

| In v1.3 | Equivalent in v4.0 | Sample |
|---|---|---|
|`EventGridClient(credentials)`|`EventGridPublisherClient(endpoint, credential)`|[Sample for client construction](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/eventgrid/azure-eventgrid/samples/sync_samples/sample_publish_events_using_cloud_events_1.0_schema.py)|
|`EventGridClient(credentials)`|`EventGridPublisherClient(endpoint, credential)`|[Sample for client construction](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/eventgrid/azure-eventgrid/samples/basic/sync_samples/sample_publish_events_using_cloud_events_1.0_schema.py)|

### Publishing Events

The `publish_events` API is replaced with `send` in v4.0. Additionally, `send` API accepts `CloudEvent`, `EventGridEvent` along with their dict representations.

| In v1.3 | Equivalent in v4.0 | Sample |
|---|---|---|
|`EventGridClient(credentials).publish_events(topic_hostname, events)`|`EventGridPublisherClient(endpoint, credential).send(events)`|[Sample for client construction](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/eventgrid/azure-eventgrid/samples/sync_samples/sample_publish_events_using_cloud_events_1.0_schema.py)|
|`EventGridClient(credentials).publish_events(topic_hostname, events)`|`EventGridPublisherClient(endpoint, credential).send(events)`|[Sample for client construction](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/eventgrid/azure-eventgrid/samples/basic/sync_samples/sample_publish_events_using_cloud_events_1.0_schema.py)|

### Consuming Events

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def test_eg_dual_client_send_custom_event(self, **kwargs):

await basic_client.send(custom_event)

with pytest.raises(TypeError):
with pytest.raises(HttpResponseError):
await namespace_client.send(custom_event)

@pytest.mark.live_test_only
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventgrid/azure-eventgrid/tests/test_eg_dual_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_eg_dual_client_send_custom_event(self, **kwargs):

basic_client.send(custom_event)

with pytest.raises(TypeError):
with pytest.raises(HttpResponseError):
namespace_client.send(custom_event)

@pytest.mark.live_test_only
Expand Down

0 comments on commit 614a928

Please sign in to comment.