-
Notifications
You must be signed in to change notification settings - Fork 182
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
fix to sql query bug in dashboard #1531
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 3027a36 in 37 seconds
More details
- Looked at
243
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_MwCPiyqiCgayWe4f
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -778,6 +778,8 @@ def get_records_and_feedback( | |||
|
|||
stmt = stmt.limit(limit).offset(offset) | |||
|
|||
print("stmt=", stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging print statement should be removed or replaced with proper logging before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx guy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on fe5bbb9 in 12 seconds
More details
- Looked at
33
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. src/core/trulens/core/database/connector/base.py:369
- Draft comment:
The PR description mentions disablingrelationship
order_by
in ORM classes, but the changes in the diff only include docstring updates. Ensure that the intended code changes are included in the PR. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_xqW2m3ngX3FvaHCl
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on a0cb8a2 in 9 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. src/core/trulens/core/database/sqlalchemy.py:779
- Draft comment:
The removal of theprint
statement for debugging SQL statements is a good practice for production code. However, the PR description mentioned adding a print statement for debugging, which seems contradictory. Please ensure the PR description accurately reflects the changes made. - Reason this comment was not posted:
Confidence changes required:50%
The print statement for debugging SQL statements was removed, which is a good practice for production code. However, the PR description mentioned adding a print statement for debugging, which seems contradictory. This might be a mistake in the PR description or the code change.
Workflow ID: wflow_ni5W0qgBmuDybmHx
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 4bc5548 in 15 seconds
More details
- Looked at
30
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. src/core/trulens/core/database/sqlalchemy.py:765
- Draft comment:
The PR description mentions adding a print statement for debugging SQL statements, but this change is not present in the diff. Ensure that the intended debugging print statement is included in the commit. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_EujvLPMap0YBFeBm
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 3d8e4d8 in 12 seconds
More details
- Looked at
170
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. src/core/trulens/core/database/sqlalchemy.py:761
- Draft comment:
The PR description mentions adding a print statement for debugging SQL statements, but no such addition is present in the diff. Ensure that the intended debugging statement is included. - Reason this comment was not posted:
Confidence changes required:50%
The PR description mentions adding a print statement for debugging SQL statements, but I don't see any such addition in the diff. This might be an oversight or a missed change.
Workflow ID: wflow_iH5R6EuWKxuMebjd
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 28f555c in 11 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. src/core/trulens/core/database/orm.py:404
- Draft comment:
Theorder_by
in thebackref
forAppDefinition.records
should be removed as per the PR description to prevent SQLAlchemy query generation issues. This applies to otherorder_by
in backrefs as well. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_j5L0gyI6JtZH0wbN
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Confirmed this resolves the dashboard bug |
|
||
# Couldn't figure out how to avoid using prefix in ForeignKey here | ||
# and in the other classes below. | ||
app_id = Column( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this require a migration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the schema has changed so I don't think so.
Description
Changed what
order_by
applies to in the orm relationships to prevent an incorrect SQL bug.Added limit and offset to
get_leaderboard
. The bug was occurring only in the dashboard because it was usingget_records_and_feedback
with a limit whereas the notebooks did not use a limit inside theirget_leaderboard
.Other details good to know for developers
Please include any other details of this change useful for TruLens developers.
Type of change
not work as expected)
Important
Fix SQL query bug in dashboard by disabling
order_by
in ORM relationships and addinglimit
andoffset
toget_leaderboard
.order_by
in ORM relationships inorm.py
to prevent SQLAlchemy query generation issues withjoinedload
andlimit
.limit
andoffset
parameters toget_leaderboard
inbase.py
andsession.py
to ensure consistent query behavior.Record
,FeedbackResult
, andGroundTruth
classes inorm.py
to removeorder_by
in relationships.print
statement for debugging SQL statements insqlalchemy.py
.This description was created by for 28f555c. It will automatically update as commits are pushed.