-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Async Tracker Store Support #10696
Async Tracker Store Support #10696
Conversation
… async-trackerstore-support
Hey @danielenricocahall sorry I was on holiday :) - have re-run it now. |
Hey @joejuzl no worries and thank you!!! And ah yes good to know - I was running a few commands manually based on what I saw in CI but the make commands are definitely easier. Let me resolve this other linting problem... |
Hey @joejuzl I've corrected most of the linting errors after running
When I navigate to these lines, they are methods which have not had any docstring modifications in this PR - only the signatures have changed (to add |
The check uses rather broad strokes to determine what needs to be checked, and since it has not been around since the start it often requires small changes to existing docstrings. Let me know if you need a hand with any of them (it should be fine to keep them fairly succinct and simple.) |
Done! :) |
Oof, then those changes caused Flake8 to complain about line length errors 😵 . Just addressed and pushed up. |
Just corrected the typing errors. With the two |
Hey @joejuzl it looks like all but one test are passing 🥳 - |
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.
💯 Fantastic job! Thanks for this 🚀 🚀 🚀
Looks like it's a random failure - re-running it now. |
Thank you! |
Looks like everything passed now but the codeclimate report update failed. |
Don't worry about that job. |
Okay great! Unfortunately, I do not have privileges to merge. |
Make `TrackerStore` interface methods asynchronous and supply an `AwaitableTrackerstore` wrapper for custom tracker stores which do not implement the methods as asynchronous. Squashed commits: * refactor tracker store and tests to be async * update core modules with async tracker store calls * update server with async tracker store calls * await tracker store call in twilio voice * add await in test rasa export * add awaits to test_agent for tracker store * add awaits to tracker store functions in processor tests * refactor exporter tests for async tracker store * use asyncmock from unittest instead of custom * add async in test_rasa_export * fixture update for async tracker store * update marker logic to handle async tracker store * fix mark tracker loader tests for async tracker store * add awaits to server and server tests * add await to dialogue test with tracker store * add await to tracker test * formatting in tracker store * more formatting fixes * more formatting fixes * address formatting changes * change return type and remove awaitable tracker store wrapper in create * make stream_events async * address comments (remove redundant methods in awaitable tracker store + raise exception) * make _run_markers and _run_markers_cli sync to ensure CLI can be run * add warning and test for creating async tracker store from endpoint config * add changelog entry * use TrackerStore instead of "TrackerStore" in typehint Co-authored-by: Joe Juzl <joejuzl@gmail.com> * use TrackerStore instead of "TrackerStore" in typehint Co-authored-by: Joe Juzl <joejuzl@gmail.com> * change user warning to deprecation warning * fix typo in comment * have fallback_tracker_store return in memory tracker store without awaitable wrapper * import async mock from conftest instead of unittest to suport Python 3.7 * delete unused imports in marker_tracker_loader * apply black to modules which failed ci linter * resolve line length linting in tracker_store.py * refer to request.app.ctx.agent object instead of request.app.agent * resolve ci failures from not adding async/await * applied black to reformat three modules failing code quality * correct most docstring linting errors * fix docstring linting errors * fix flake8 line length errors * fix mypy type checking errors * linting corrections after adding type ignores to methods * delete extra periods in docstring Co-authored-by: Joe Juzl <joejuzl@gmail.com>
This is an effort to make tracker stores asynchronous, based off of the work initially done in this PR and it should address [this issue] (#8774). I've tried to account for the comments made in the original PR and reduce the surface area/object wrapping from the original implementation, but that comes at a trade-off - specifically making the other tracker store methods async.
Also, should we convert some of the tracker store implementations to use async APIs (i.e; AIORedis for AioRedis, Motor for Mongo)?
. First PR, so entirely open to feedback!
Status (please check what you already did):
black
(please check Readme for instructions)