-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Remove System Events #16358
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
Remove System Events #16358
Changes from all commits
2c57c04
c157367
b34a4fa
c3b2f3c
b9a4146
a52157f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,9 @@ class EventGridDeserializer(object): | |
| def deserialize_cloud_events(self, cloud_event, **kwargs): # pylint: disable=no-self-use | ||
| # type: (Union[str, dict, bytes], Any) -> CloudEvent | ||
| """Single event following CloudEvent schema will be parsed and returned as Deserialized Event. | ||
| Use `.data` to get the data in the raw format. To check the list of recognizable system topics, | ||
| visit https://docs.microsoft.com/azure/event-grid/system-topics. | ||
|
|
||
| :param cloud_event: The event to be deserialized. | ||
| :type cloud_event: Union[str, dict, bytes] | ||
| :rtype: CloudEvent | ||
|
|
@@ -34,11 +37,8 @@ def deserialize_cloud_events(self, cloud_event, **kwargs): # pylint: disable=no- | |
| try: | ||
| cloud_event = CloudEvent._from_json(cloud_event, encode) # pylint: disable=protected-access | ||
| deserialized_event = CloudEvent._from_generated(cloud_event) # pylint: disable=protected-access | ||
| CloudEvent._deserialize_data(deserialized_event, deserialized_event.type) # pylint: disable=protected-access | ||
| return deserialized_event | ||
| except Exception as err: | ||
| _LOGGER.error('Error: cannot deserialize event. Event does not have a valid format. \ | ||
| Event must be a string, dict, or bytes following the CloudEvent schema.') | ||
| _LOGGER.error('Your event: %s', cloud_event) | ||
| _LOGGER.error(err) | ||
| raise ValueError('Error: cannot deserialize event. Event does not have a valid format. \ | ||
|
|
@@ -47,6 +47,9 @@ def deserialize_cloud_events(self, cloud_event, **kwargs): # pylint: disable=no- | |
| def deserialize_eventgrid_events(self, eventgrid_event, **kwargs): # pylint: disable=no-self-use | ||
| # type: (Union[str, dict, bytes], Any) -> EventGridEvent | ||
| """Single event following EventGridEvent schema will be parsed and returned as Deserialized Event. | ||
| Use `.data` to get the data in the raw format. To check the list of recognizable system topics, | ||
| visit https://docs.microsoft.com/azure/event-grid/system-topics. | ||
|
|
||
| :param eventgrid_event: The event to be deserialized. | ||
| :type eventgrid_event: Union[str, dict, bytes] | ||
| :rtype: EventGridEvent | ||
|
|
@@ -57,11 +60,8 @@ def deserialize_eventgrid_events(self, eventgrid_event, **kwargs): # pylint: dis | |
| try: | ||
| eventgrid_event = EventGridEvent._from_json(eventgrid_event, encode) # pylint: disable=protected-access | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above, will need updating once
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have this tracked in the decode changes where i'm including a _to_json as well (along with a _from_json) #16352 |
||
| deserialized_event = EventGridEvent.deserialize(eventgrid_event) | ||
| EventGridEvent._deserialize_data(deserialized_event, deserialized_event.event_type) # pylint: disable=protected-access | ||
| return cast(EventGridEvent, deserialized_event) | ||
| except Exception as err: | ||
| _LOGGER.error('Error: cannot deserialize event. Event does not have a valid format. \ | ||
| Event must be a string, dict, or bytes following the CloudEvent schema.') | ||
| _LOGGER.error('Your event: %s', eventgrid_event) | ||
| _LOGGER.error(err) | ||
| raise ValueError('Error: cannot deserialize event. Event does not have a valid format. \ | ||
|
|
||
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 will need updating I believe once you change the
_from_jsonto_to_json:)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.
see #16352
Uh oh!
There was an error while loading. Please reload this page.
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.
so I just realize that currently the
_from_jsonaccepts a json string and returns a json/dict object?and if I'm understanding correctly, we're gonna have a separate PR which has the methods matching the functionality?
(probably we could be a bit verbose on the method name, like
_from_json_str,_to_json_object-ish)