From 5087ce52a17d3c0d7b17117bc7421a489b61e3b7 Mon Sep 17 00:00:00 2001 From: Naresh Kumar <113932371+sfc-gh-nkumar@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:49:54 -0700 Subject: [PATCH] SNOW-1320309: Remove unnecessary warning from sort_values (#2306) Remove warning from sort_values when sort algorithm is 'quicksort'. We still raise warning if user passed a sort algorithm explicitly like `mergesort` for `quicksort` is default value so it doesn't make sense to raise this warning. --------- Co-authored-by: Naren Krishna --- CHANGELOG.md | 1 + .../modin/plugin/compiler/snowflake_query_compiler.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b62532bd333..a8bc7dd5753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Improved `to_pandas` to persist the original timezone offset for TIMESTAMP_TZ type. - Improved `dtype` results for TIMESTAMP_TZ type to show correct timezone offset. - Improved error message when passing non-bool value to `numeric_only` for groupby aggregations. +- Removed unnecessary warning about sort algorithm in `sort_values`. #### New Features diff --git a/src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py b/src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py index 84a48dcd020..4ec319b1b15 100644 --- a/src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py +++ b/src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py @@ -3355,9 +3355,10 @@ def sort_rows_by_column_values( # This error message is different from native pandas hence, hence it is kept here instead # of moving this to frontend layer. raise ValueError(f"sort kind must be 'stable' or None (got '{kind}')") - if kind != "stable": + # Do not show warning for 'quicksort' as this the default option. + if kind not in ("stable", "quicksort"): logging.warning( - f"choice of sort algorithm '{kind}' is ignored. sort kind must be 'stable' or None" + f"choice of sort algorithm '{kind}' is ignored. sort kind must be 'stable', 'quicksort', or None" ) matched_identifiers = (