-
Notifications
You must be signed in to change notification settings - Fork 143
Description
-
What version of Python are you using?
Python 3.9.6 (default, Oct 17 2025, 17:15:53)
[Clang 17.0.0 (clang-1700.4.4.1)] -
What are the Snowpark Python and pandas versions in the environment?
pandas==2.3.3
snowflake-snowpark-python==1.43.0 -
What did you do?
When running the script below with the lag function, local-testing produces ValueError: 10 is not in list.
This error only appears on a specific set of values as demonstrated in a script with "group_ok" and "group_error" columns. -
What did you expect to see?
When running the same snowpark code in Snowflake I get the following result:
output.csvThe code I used to run in Snowflake to verify expected behavior:
snowflake_run.sql
Potential fix
There is a similar issue raised for other window functions like this one: #3459 which was followed by PR: #3462.
But it looks like lag and lead functions have a special handling logic in file _plan.py which was not touched in this PR. The issue looks very similar though and replacing res_index with pd_index in the line below fixed the issue locally for me.
