-
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
Fix Cortex provider for tests. #1666
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
) | ||
): | ||
if ( | ||
hasattr(self, "DEFAULT_SNOWPARK_SESSION") |
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.
The hasattr
check for DEFAULT_SNOWPARK_SESSION
is redundant since it's a class variable and will always exist. Directly check if self.DEFAULT_SNOWPARK_SESSION
is not None
. This applies to line 110.
hasattr(self, "DEFAULT_SNOWPARK_SESSION") | |
self.DEFAULT_SNOWPARK_SESSION is not None |
@@ -100,12 +103,30 @@ def __init__( | |||
*args, **kwargs | |||
) | |||
|
|||
self_kwargs["snowpark_session"] = ( | |||
if snowpark_session is None or pyschema_utils.is_noserio( |
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.
ah thanks for fixing this - I missed checking explicitly the case where session exists but non-serializable
Description
Fix Cortex provider for tests.
Other details good to know for developers
Type of change
not work as expected)
Important
Fixes Cortex provider's Snowflake session handling by introducing a default session and updating test setup.
DEFAULT_SNOWPARK_SESSION
toCortex
class inprovider.py
for default session handling.DEFAULT_SNOWPARK_SESSION
if no session is provided or ifpyschema_utils.is_noserio()
returns true.ValueError
if session inference fails, suggesting settingDEFAULT_SNOWPARK_SESSION
.Cortex.DEFAULT_SNOWPARK_SESSION
insetUp()
ofSnowflakeTestCase
insnowflake_test_case.py
to ensure consistent session usage across tests.test-snowflake
target for running Snowflake-specific tests.This description was created by for 0e17bc1. It will automatically update as commits are pushed.