Skip to content

Conversation

t-swpill
Copy link
Contributor

Added EventGrid Track 2 Convenience Layer EventGridPublisherClient implementation based on discussed design. Added single test for sending EventGridEvents through EventGridPublisherClient.

@t-swpill t-swpill marked this pull request as ready for review August 7, 2020 18:02
@t-swpill
Copy link
Contributor Author

t-swpill commented Aug 8, 2020

(At least) two bugs that need to be fixed:

  1. urllib.parse.quote is used in the azure/eventgrid/_helpers.py file, which will not work for Python 2.7. It should account for this different version.
  2. the FakeResource() in tests/eventgrid_preparer.py should have all the properties of the real topic, but it currently doesn't since I've only ran the tests live locally. They need to run non-live locally too, by changing the live:true/false setting in testsettings_local.cfg file

@lmazuel lmazuel changed the base branch from master to event_grid_v2 August 10, 2020 22:05
@lmazuel lmazuel merged commit ee0293b into Azure:event_grid_v2 Aug 10, 2020
rakshith91 pushed a commit that referenced this pull request Aug 20, 2020
* Event grid track 2 (#12768)

* genereated python client for event grid

* updated readme to use track2 generator

* added sas key auth sample

* added consume sample, not final

* removing old eg

* added track 2 changes needed for api view

* add consumer operations

* cleanup client versions for api view

* remove _initialize_mapping() in BaseEventType class in models

* track 2 design manual changes

* added publisher wrapper in azure/eventgrid for demo

* modified naming for publish sample for demo

* final sample fix for demo

* added response to publish_events(), still need to fix

* added decoder for apiview

* renamed consumer, added Deserialized/CustomEvent

* final for Board Review

* testing changes

* added EventGridSharedAccessSignatureCredential,Policy and modified samples

* added eg_client test

* moving generated code out from event_grid_publisher_client nested folder

* added consumption function samples

* removed eg required package and removed service bus dependency in consumer

* removed unnecessary functions

* changed consumer deserialize_event() to take,return single event of one type of (string, bytes string, dict). changed DeserializedEvent to have to_json() method, instead of extending DictMixin

* added publish tests

* fixed PR, added CustomEvent, added tests/samples

* updated swagger, removed unnecessary imports

* removed unnecessary reqs in dev_requirements

* changed async publisher import path, added type hints

* modified typehints for publishers, based on apiview

* added newlines

* added shared_reqs file

* moved shared_requirement

* fixed non live test

* added changelog, test fix

* changed topic preparer

* added samples to exclude to setup.py

* Packaging update of azure-eventgrid

* Fix Tests (#13024)

* Fix Tests

* other fixes

* Packaging update of azure-eventgrid

* tests fix (#13026)

* other fixes

* p2 compat

* Packaging update of azure-eventgrid

* Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md

* Event grid v2 (#13051)

* other fixes

* auto update

* Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md

* Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py

* Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md

* Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py

* Event grid v2 (#13177)

* other fixes

* auto update

* Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md

* Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py

* Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md

* Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py

* comments

* Update sdk/eventgrid/azure-eventgrid/tests/_mocks.py

* Event grid v2 (#13201)

* other fixes

* auto update

* Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md

* Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py

* Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md

* Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py

* comments

* tests fix

* Update sdk/eventgrid/azure-eventgrid/tests/eventgrid_preparer.py

* Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py

Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com>

* Apply suggestions from code review

Co-authored-by: t-swpill <66144935+t-swpill@users.noreply.github.com>
Co-authored-by: Azure SDK Bot <adxpysdk@microsoft.com>
Co-authored-by: Rakshith Bhyravabhotla <sabhyrav@microsoft.com>
Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com>
rakshith91 pushed a commit to rakshith91/azure-sdk-for-python that referenced this pull request Aug 20, 2020
* genereated python client for event grid

* updated readme to use track2 generator

* added sas key auth sample

* added consume sample, not final

* removing old eg

* added track 2 changes needed for api view

* add consumer operations

* cleanup client versions for api view

* remove _initialize_mapping() in BaseEventType class in models

* track 2 design manual changes

* added publisher wrapper in azure/eventgrid for demo

* modified naming for publish sample for demo

* final sample fix for demo

* added response to publish_events(), still need to fix

* added decoder for apiview

* renamed consumer, added Deserialized/CustomEvent

* final for Board Review

* testing changes

* added EventGridSharedAccessSignatureCredential,Policy and modified samples

* added eg_client test

* moving generated code out from event_grid_publisher_client nested folder

* added consumption function samples

* removed eg required package and removed service bus dependency in consumer

* removed unnecessary functions

* changed consumer deserialize_event() to take,return single event of one type of (string, bytes string, dict). changed DeserializedEvent to have to_json() method, instead of extending DictMixin

* added publish tests

* fixed PR, added CustomEvent, added tests/samples

* updated swagger, removed unnecessary imports

* removed unnecessary reqs in dev_requirements

* changed async publisher import path, added type hints

* modified typehints for publishers, based on apiview

* added newlines

* added shared_reqs file

* moved shared_requirement

* fixed non live test

* added changelog, test fix

* changed topic preparer

* added samples to exclude to setup.py
rakshith91 pushed a commit that referenced this pull request Aug 27, 2020
* Event grid track 2 (#12768)

* genereated python client for event grid

* updated readme to use track2 generator

* added sas key auth sample

* added consume sample, not final

* removing old eg

* added track 2 changes needed for api view

* add consumer operations

* cleanup client versions for api view

* remove _initialize_mapping() in BaseEventType class in models

* track 2 design manual changes

* added publisher wrapper in azure/eventgrid for demo

* modified naming for publish sample for demo

* final sample fix for demo

* added response to publish_events(), still need to fix

* added decoder for apiview

* renamed consumer, added Deserialized/CustomEvent

* final for Board Review

* testing changes

* added EventGridSharedAccessSignatureCredential,Policy and modified samples

* added eg_client test

* moving generated code out from event_grid_publisher_client nested folder

* added consumption function samples

* removed eg required package and removed service bus dependency in consumer

* removed unnecessary functions

* changed consumer deserialize_event() to take,return single event of one type of (string, bytes string, dict). changed DeserializedEvent to have to_json() method, instead of extending DictMixin

* added publish tests

* fixed PR, added CustomEvent, added tests/samples

* updated swagger, removed unnecessary imports

* removed unnecessary reqs in dev_requirements

* changed async publisher import path, added type hints

* modified typehints for publishers, based on apiview

* added newlines

* added shared_reqs file

* moved shared_requirement

* fixed non live test

* added changelog, test fix

* changed topic preparer

* added samples to exclude to setup.py

* Packaging update of azure-eventgrid

* Packaging update of azure-eventgrid

* tests fix (#13026)

* other fixes

* p2 compat

* Packaging update of azure-eventgrid

* Event grid v2 (#13051)

* other fixes

* auto update

* Send spec initial

* recordings

* tests fix

* Update sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_dict.yaml

* Apply suggestions from code review

* Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py

* analyze

* Apply suggestions from code review

Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com>

* async tests

* no async for py2

* comment

* Apply suggestions from code review

Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com>

* Apply suggestions from code review

Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com>

* Apply suggestions from code review

Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com>

Co-authored-by: t-swpill <66144935+t-swpill@users.noreply.github.com>
Co-authored-by: Azure SDK Bot <adxpysdk@microsoft.com>
Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Event Grid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants