Skip to content
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

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

sfc-gh-pdharmana
Copy link
Contributor

@sfc-gh-pdharmana sfc-gh-pdharmana commented Oct 30, 2024

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

  • [ x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • New Tests
  • This change includes re-generated golden test results
  • This change requires a documentation update

Important

Ensure Cortex only accepts a Snowflake connection object by checking for a cursor method in provider.py.

  • Behavior:
    • In Cortex.__init__, added a check to ensure snowflake_conn has a cursor method, raising ValueError if not.
    • Updated docstring for snowflake_conn to clarify it should not be a session object.

This description was created by Ellipsis for d5bf12b. It will automatically update as commits are pushed.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Oct 30, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 in 1 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 the snowflake_conn has a cursor 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.

@sfc-gh-pdharmana sfc-gh-pdharmana enabled auto-merge (squash) October 30, 2024 21:04
@@ -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",
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@sfc-gh-jreini sfc-gh-jreini self-requested a review October 31, 2024 14:26
@sfc-gh-pdharmana sfc-gh-pdharmana merged commit 93c38a7 into main Oct 31, 2024
7 checks passed
@sfc-gh-pdharmana sfc-gh-pdharmana deleted the provider-docs branch October 31, 2024 14:26
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants