-
Notifications
You must be signed in to change notification settings - Fork 117
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
SNOW-1455291: Unit Tests broken after upgrading to Snowpark 1.17 or 1.18 #1705
Comments
thanks @jeromesubs for reporting, I'm sorry that your unit test is broken, we will look into this issue asap. |
hi @jeromesubs , can you share with me some more details on how |
Here is the class and method:
Both get_instrument and get_iccr are simple table select like below, but they are mocked in the UT:
The mock methods for creating empty dataframe look like this:
|
thanks for the code, it's very helpful to debugging. |
hi @jeromesubs, we have merged the PR, it will be carried in our next release which is expected to happen next week. |
Please answer these questions before submitting your issue. Thanks!
~ python3 --version --version
Python 3.11.8 (main, Feb 26 2024, 21:39:34) [GCC 11.2.0]
~ python3 -m pip freeze | grep -e "snowpark" -e "pandas"
pandas==2.2.1
snowflake-snowpark-python==1.18.0
We upraded our solution from Snowpark 1.16 to 1.17 (and the 1.18)
And ran our PyTest tests in PyCharm
I expected all my unit tests to keep working, but 3 of them are now broken with the same error:
-------------------------------- live log setup --------------------------------
2024-05-29 20:57:20 >> snowflake.connector.connection >> INFO >> 699795 >> MainProcess >> 140457944372288 >> /home/xxx/miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/connector/connection.py >> Snowflake Connector for Python Version: 3.10.0, Python Version: 3.11.8, Platform: Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
2024-05-29 20:57:20 >> snowflake.snowpark.session >> INFO >> 699795 >> MainProcess >> 140457944372288 >> /home/xxx/miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/session.py >> Snowpark Session information:
"version" : 1.18.0,
"python.version" : 3.11.8,
"python.connector.version" : 3.10.0,
"python.connector.session.id" : 1,
"os.name" : Linux
FAILED [ 8%]
/brs/br001_test.py:37 (TestBr001ValidateInputData.test_br001_validate_input_data_empty)
self = <brs.br001_test.TestBr001ValidateInputData testMethod=test_br001_validate_input_data_empty>
/brs/br001_test.py:56:
../apps/snowpark/instrument/business_rules/br001_validate_input_data.py:18: in validate_input_data
if df_instrument.count() == 0:
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/dataframe.py:2977: in count
result = df._internal_collect_with_tag(
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/_internal/telemetry.py:145: in wrap
result = func(*args, **kwargs)
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/dataframe.py:645: in _internal_collect_with_tag_no_telemetry
return self._session._conn.execute(
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/mock/_connection.py:619: in execute
res = execute_mock_plan(plan, plan.expr_to_alias)
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/mock/plan.py:670: in execute_mock_plan
from_df = execute_mock_plan(from, expr_to_alias)
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/mock/_plan.py:661: in execute_mock_plan
return execute_mock_plan(source_plan.execution_plan, expr_to_alias)
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/mock/_plan.py:829: in execute_mock_plan
child_rf = execute_mock_plan(source_plan.child, expr_to_alias)
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/snowflake/snowpark/mock/_plan.py:715: in execute_mock_plan
null_rows_idxs_map[column_name] = column_series._null_rows_idxs
E AttributeError: 'TableEmulator' object has no attribute '_null_rows_idxs'
../../../../miniconda3/envs/venv311/lib/python3.11/site-packages/pandas/core/generic.py:6296: AttributeError
The text was updated successfully, but these errors were encountered: