Skip to content

Commit

Permalink
order SQL events
Browse files Browse the repository at this point in the history
  • Loading branch information
ricwo committed Sep 10, 2019
1 parent dcff691 commit 460a501
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.rst
Expand Up @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file.
This project adheres to `Semantic Versioning`_ starting with version 1.0.


[Unreleased 1.2.8] - `master`_
[Unreleased 1.2.9] - `master`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Added
Expand All @@ -23,6 +23,15 @@ Fixed
-----


[1.2.8] - 2019-09-10
^^^^^^^^^^^^^^^^^^^^

Fixed
-----
- SQL tracker events are retrieved ordered by timestamps. This fixes interactive
learning events being shown in the wrong order.


[1.2.7] - 2019-09-02
^^^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 3 additions & 1 deletion rasa/core/tracker_store.py
Expand Up @@ -451,7 +451,9 @@ def retrieve(self, sender_id: Text) -> Optional[DialogueStateTracker]:
"""Create a tracker from all previously stored events."""

query = self.session.query(self.SQLEvent)
result = query.filter_by(sender_id=sender_id).all()
result = (
query.filter_by(sender_id=sender_id).order_by(self.SQLEvent.timestamp).all()
)
events = [json.loads(event.data) for event in result]

if self.domain and len(events) > 0:
Expand Down
2 changes: 1 addition & 1 deletion rasa/version.py
@@ -1 +1 @@
__version__ = "1.2.7"
__version__ = "1.2.8"

0 comments on commit 460a501

Please sign in to comment.