From 76c64fe8142428a4e8708005e9a26126c6ff02f2 Mon Sep 17 00:00:00 2001 From: vcidst Date: Mon, 4 Mar 2024 15:27:42 +0100 Subject: [PATCH] add context in docstring and comment --- rasa/core/exporter.py | 1 + rasa/core/tracker_store.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/rasa/core/exporter.py b/rasa/core/exporter.py index e41016c47a33..2961b6b6fc94 100644 --- a/rasa/core/exporter.py +++ b/rasa/core/exporter.py @@ -243,6 +243,7 @@ async def _fetch_events_within_time_range(self) -> AsyncIterator[Dict[Text, Any] events = self._get_events_for_conversation_id(_events, conversation_id) # the order of events was changed after ATO-2192 + # more context: https://github.com/RasaHQ/rasa/pull/13019 # we should sort the events by timestamp to keep the order events.sort(key=lambda x: x["timestamp"]) diff --git a/rasa/core/tracker_store.py b/rasa/core/tracker_store.py index 92d596167195..a91f9f5c6b87 100644 --- a/rasa/core/tracker_store.py +++ b/rasa/core/tracker_store.py @@ -1291,6 +1291,9 @@ def _event_query( self, session: "Session", sender_id: Text, fetch_events_from_all_sessions: bool ) -> "Query": """Provide the query to retrieve the conversation events for a specific sender. + The events are ordered by ID to ensure correct sequence of events. + As `timestamp` is not guaranteed to be unique and low-precision (float), it + cannot be used to order the events. Args: session: Current database session.