Skip to content

Commit

Permalink
added more notes
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pmardziel committed Oct 3, 2024
1 parent a0cb8a2 commit 4bc5548
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/trulens/core/database/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ class Record(base):
# Notice that trulens_records is in a subquery and named "anon_1"
# but then it is used in the ORDER BY outside of the subquery
# referred to by its non-aliased name that was never selected in the
# main query.
# main query. If one of the joinedloads in get_records_and_feedback
# is removed or if the limit is removed, the query does not use a
# subquery and no bug happens.

@classmethod
def parse(
Expand Down
3 changes: 3 additions & 0 deletions src/core/trulens/core/database/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,9 @@ def get_records_and_feedback(
# feedback_results and app definitions get loaded eagerly instead if lazily when
# accessed later.

# NOTE(piotrm): Strange issue in sqlalchemy if two joinedloads and a
# limit/offset are used. See orm.py "NOTE(piotrm): order_by".

# TODO(piotrm): The subsequent logic in helper methods end up
# reading all of the records and feedback_results in order to create
# a DataFrame so there is no reason to not eagerly get all of this
Expand Down

0 comments on commit 4bc5548

Please sign in to comment.