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

DynamoDB Tracker Store does not pull all sender_ids #9195

Closed
kearnsw opened this issue Jul 24, 2021 · 3 comments · Fixed by #9196
Closed

DynamoDB Tracker Store does not pull all sender_ids #9195

kearnsw opened this issue Jul 24, 2021 · 3 comments · Fixed by #9196
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@kearnsw
Copy link
Contributor

kearnsw commented Jul 24, 2021

Rasa Version : 2.8.0
Minimum Compatible Version: 2.8.0
Rasa SDK Version : 2.8.0
Rasa X Version : None
Python Version : 3.7.10
Operating System : Darwin-20.5.0-x86_64-i386-64bit

Issue:
The dynamodb tracker store only pulls the first batch of sender_ids. It needs to loop in order to pull all sender_ids.

@kearnsw kearnsw added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Jul 24, 2021
@kearnsw kearnsw mentioned this issue Jul 24, 2021
2 tasks
@sara-tagger
Copy link
Collaborator

Thanks for raising this issue, @wochinge will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗

@wochinge
Copy link
Contributor

Which code / command are you using to cause the error @kearnsw ?

@kearnsw
Copy link
Contributor Author

kearnsw commented Jul 26, 2021

Hi @wochinge,

I am using the Exporter, which has the following code that is causing the error:

    def _get_conversation_ids_in_tracker(self) -> Set[Text]:
        """Fetch conversation IDs in `self.tracker_store`.
        Returns:
            A set of conversation IDs in `self.tracker_store`.
        Raises:
            `NoConversationsInTrackerStoreError` if
            `conversation_ids_in_tracker_store` is empty.
        """
        conversation_ids_in_tracker_store = set(self.tracker_store.keys())

        if conversation_ids_in_tracker_store:
            return conversation_ids_in_tracker_store

        raise NoConversationsInTrackerStoreError(
            "Could not find any conversations in connected tracker store. "
            "Please validate your `endpoints.yml` and make sure the defined "
            "tracker store exists. Exiting."
        )

This, in turn, calls the following when the endpoints.yml file is set to use DynamoDB tracker store:

    def keys(self) -> Iterable[Text]:
        """Returns sender_ids of the `DynamoTrackerStore`."""
        return [
            i["sender_id"]
            for i in self.db.scan(ProjectionExpression="sender_id")["Items"]
        ]

This is the incorrect way to pull all values from DynamoDB the correct way is implemented in #9196.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants