Skip to content

Conversation

@rakshith91
Copy link
Contributor

Fixes #16351

@rakshith91
Copy link
Contributor Author

/azp run python - eventgrid - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rakshith91
Copy link
Contributor Author

/azp run python - eventgrid - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@swathipil swathipil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few small comments that you may already have already thought of or have plans to change in other PRs. pls lmk if this is the case, I can approve!

"""
encode = kwargs.pop('encoding', 'utf-8')
try:
cloud_event = CloudEvent._from_json(cloud_event, encode) # pylint: disable=protected-access
Copy link
Member

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_json to _to_json :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #16352

Copy link
Contributor

@yunhaoling yunhaoling Jan 28, 2021

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_json accepts 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)

"""
encode = kwargs.pop('encoding', 'utf-8')
try:
eventgrid_event = EventGridEvent._from_json(eventgrid_event, encode) # pylint: disable=protected-access
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, will need updating once _from_json is changed _to_json

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

"""
import json
from azure.eventgrid import EventGridDeserializer, EventGridEvent
from azure.eventgrid.systemevents import StorageBlobCreatedEventData
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the _deserialize_data method will be removed from EventMixin, it might be useful to add samples (or add within this sample) of how SystemEventMappings can be used with the data/type after deserializing cloud/eg events. (if you already have something like this in the works, ignore this comment :) )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here - the samples will significantly change in the above issue i mentioned - so will update there

@rakshith91 rakshith91 merged commit 82e5afc into Azure:master Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EG] get rid of the system events

3 participants