Skip to content
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

Record new AnalyticsEvents asynchronously #50

Merged
merged 6 commits into from
Apr 6, 2022
Merged

Conversation

PSalant726
Copy link
Contributor

Closes #32

SDK Changes

  • Simplifies the merging of event.extra_data into client.extra_data
  • Adds the aiohttp dependency
    • Enables "proper" async requests
  • AnalyticsClient.send uses aiohttp to make asynchronous requests

@PSalant726 PSalant726 added the enhancement New feature or request label Apr 5, 2022
@PSalant726 PSalant726 requested a review from SteveDMurphy April 5, 2022 23:48
@PSalant726 PSalant726 self-assigned this Apr 5, 2022
SteveDMurphy
SteveDMurphy previously approved these changes Apr 6, 2022
Copy link
Contributor

@SteveDMurphy SteveDMurphy left a comment

Choose a reason for hiding this comment

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

Looks great @PSalant726 !! Tested everything locally and confirmed it works as expected.

Left one question about the union operator with dicts is all, great work! 🚀

fideslog/sdk/python/client.py Outdated Show resolved Hide resolved
fideslog/sdk/python/event.py Show resolved Hide resolved
The addition of the `|` operator in
267bcf5
creates a requirement for Python v3.9+.
@PSalant726 PSalant726 merged commit 030df6a into main Apr 6, 2022
@PSalant726 PSalant726 deleted the async-requests branch April 6, 2022 19:44
PSalant726 added a commit to ethyca/fides that referenced this pull request Apr 15, 2022
Fideslog v1.1.0 changes the `AnalyticsClient.send` interface such that
it automatically executes the request in a separate event loop. There
is no longer a need to manually wrap the call in `asyncio.run` or
similar.

These changes were introduced in ethyca/fideslog#50
PSalant726 added a commit to ethyca/fides that referenced this pull request Apr 18, 2022
* Update the usage of `AnalyticsClient.send`, bump fideslog to v1.1.0

Fideslog v1.1.0 changes the `AnalyticsClient.send` interface such that
it automatically executes the request in a separate event loop. There
is no longer a need to manually wrap the call in `asyncio.run` or
similar.

These changes were introduced in ethyca/fideslog#50

* Use the new `OPT_OUT_PROMPT` constant

* `AnalyticsException` --> `AnalyticsError`

* Bump fideslog to v1.1.1

* Bump fideslog to v1.1.2

* Bump fideslog to v1.1.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send AnalyticsEvents via the SDK Asynchronously
2 participants