Skip to content

Commit

Permalink
SNOW-1320309: Remove unnecessary warning from sort_values (#2306)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sfc-gh-nkumar and sfc-gh-nkrishna authored Sep 19, 2024
1 parent 4a4a61d commit 5087ce5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down

0 comments on commit 5087ce5

Please sign in to comment.