-
Notifications
You must be signed in to change notification settings - Fork 198
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
Allow Cortex provider to only take a connection object. #1617
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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! Reviewed everything up to d5bf12b in 23 seconds
More details
- Looked at
25
lines of code in1
files - Skipped
1
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. src/providers/cortex/trulens/providers/cortex/provider.py:109
- Draft comment:
Consider providing more guidance in the error message about what constitutes a valid Snowflake connection object. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces a check to ensure that thesnowflake_conn
has acursor
method, which is a good validation step. However, the error message could be more informative by suggesting what a valid connection object should be.
Workflow ID: wflow_UOOSEy8zFNLQXruF
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -229,7 +229,7 @@ | |||
"\n", | |||
"snowpark_session = Session.builder.configs(connection_params).create()\n", | |||
"\n", | |||
"provider = Cortex(snowpark_session, \"llama3.1-8b\")\n", | |||
"provider = Cortex(snowpark_session.connection, \"llama3.1-8b\")\n", |
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.
we used to only require the snowpark_session
here. why did we change this?
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.
We always needed connection for providers.
Description
Cortex provider will not accept a session object, and we have seen this as an accidental thing many users are doing.
Type of change
not work as expected)
Important
Ensure
Cortex
only accepts a Snowflake connection object by checking for acursor
method inprovider.py
.Cortex.__init__
, added a check to ensuresnowflake_conn
has acursor
method, raisingValueError
if not.snowflake_conn
to clarify it should not be a session object.This description was created by for d5bf12b. It will automatically update as commits are pushed.