Skip to content

Commit

Permalink
Merge pull request #4271 from r-m-n/fix_SQLTrackerStore
Browse files Browse the repository at this point in the history
order retrieved events in SQLTrackerStore
  • Loading branch information
tabergma committed Aug 21, 2019
2 parents a2a1a91 + 4b1edf9 commit a560410
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rasa/core/tracker_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,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

0 comments on commit a560410

Please sign in to comment.