-
Notifications
You must be signed in to change notification settings - Fork 118
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-1348700: Error on .filter for specific filters #1440
Comments
Hi @sfc-gh-stan was able to slowly comment out various part of this query and was able to finally narrow down on the exact piece of code that's causing this issue. The select statement is the issue: df_reviews_selected = (
df_reviews_filtered.select(
[
col("id").alias("review_data_id"),
]
+ [col(c) for c in REVIEWS_FOR_USER_DATA_COLUMNS]
+ [
when(
col("prev_quarter_action").is_null(),
cast(lit("new"), StringType()),
)
.when(
lower(col("prev_quarter_action")).like("approved/keep%"),
cast(lit("approved"), StringType()),
)
.otherwise(col("prev_quarter_action"))
.alias("last_action")
]
+ [
col("lookback_ans_choice").alias("Why was this originally Granted?"),
col("lookback_ans_choice_wn").alias("Why are you revoking this Role?"),
count("*").over().alias("FULL_COUNT"),
]
)
.order_by([col("review_data_id")], ascending=True)
.limit(
n=page_size,
offset=offset,
)
) And specifically this column when disabled and made simple causes the entire query's test to go through successfully for the given data but when left as show above errors out: + [
when(
col("prev_quarter_action").is_null(),
cast(lit("new"), StringType()),
)
.when(
lower(col("prev_quarter_action")).like("approved/keep%"),
cast(lit("approved"), StringType()),
)
.otherwise(col("prev_quarter_action"))
.alias("last_action")
] when the above piece of code is replaced with the below code within the select statement. It all works and passes the test: + [
col("prev_quarter_action").alias("last_action")
] So I think it's the chained |
A fix for this was released in v1.19.0 |
Please answer these questions before submitting your issue. Thanks!
Python 3.10.11
We have a function as below which queries a Snowflake table. If specific filters are specified we then apply the filter by adding a
.filter
. If that filter is unspecified we then skip applying that filter.The situation here is that on the
states
,cost_centers
andemployee_names
filters we get the error shown below the function definition.When we don't specify those filters it all works as expected.
This is the test setup:
This is the test:
Error:
Full Trace:
We expected filtered results for that query.
The text was updated successfully, but these errors were encountered: