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

Export events continuously rather than loading all events in memory first #11623

Merged
merged 6 commits into from Oct 10, 2022

Conversation

tmbo
Copy link
Member

@tmbo tmbo commented Oct 6, 2022

Proposed changes:

  • use an iterator rather than storing all events in an array first
  • continuously push events to the broker
  • loading all data into memory before sending it off to the broker is infeasible for large datasets

Fixes https://rasahq.atlassian.net/browse/ATO-441

@tmbo tmbo requested a review from a team as a code owner October 6, 2022 08:44
@tmbo tmbo requested review from znat, ancalita and a team and removed request for a team October 6, 2022 08:44
Copy link
Member

@ancalita ancalita left a comment

Choose a reason for hiding this comment

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

LGTM ⚡ Left two questions about some code that was removed.

rasa/core/exporter.py Show resolved Hide resolved
Comment on lines -317 to -320
if not events:
raise NoEventsInTimeRangeError(
"Could not find any events within requested time range. Exiting."
)
Copy link
Member

Choose a reason for hiding this comment

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

Should we retain raising this exception if published_events == 0 in publish_events() after going through generator results?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this is helpful tbh. There is output on how many events got produced and that will just be 0 in this case. but happy to readd it

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense! I asked in case this exception is handled maybe in some custom way either in the codebase already or in a customer's project, that could have required further amendments.

@tmbo tmbo requested a review from ancalita October 10, 2022 08:54
@github-actions
Copy link
Contributor

🚀 A preview of the docs have been deployed at the following URL: https://11623--rasahq-docs-rasa-v2.netlify.app/docs/rasa

@tmbo tmbo merged commit f539703 into main Oct 10, 2022
@tmbo tmbo deleted the yielding-export branch October 10, 2022 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants