SNOW-1367643: When/Otherwise throws a KeyError depending on the order of the select vs where clause #1519
Labels
bug
Something isn't working
local testing
Local Testing issues/PRs
needs triage
Initial RCA is required
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using?
Python 3.10.4 (main, May 26 2022, 13:33:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
What are the Snowpark Python and pandas versions in the environment?
pandas==2.2.1
snowflake-snowpark-python==1.15.0
What did you do?
I'm trying to test a when().otherwise() operation and it throws a KeyError exception if the where() clause is placed before the select() clause.
As noted in the comment, changing the order of operations by calling select(...) before where(...) works. However, this won't work for all use cases since there are cases where a select doesn't include a column that's filtered on. For example, given the inputs above:
I expected two results:
The text was updated successfully, but these errors were encountered: