Skip to content

Commit 4f2433e

Browse files
committed
add test for sort by all
1 parent 395609d commit 4f2433e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/integ/test_df_sort.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55

66
import pytest
7-
7+
from unittest import mock
88
from snowflake.snowpark import Column
99

1010

@@ -72,3 +72,14 @@ def test_sort_invalid_inputs(session):
7272
"sort() only accepts str and Column objects,"
7373
" or a list containing str and Column objects" in str(ex_info)
7474
)
75+
76+
with mock.patch(
77+
"snowflake.snowpark.context._is_snowpark_connect_compatible_mode", True
78+
):
79+
# empty
80+
with pytest.raises(ValueError) as ex_info:
81+
df.sort()
82+
assert "sort() needs at least one sort expression" in str(ex_info)
83+
with pytest.raises(ValueError) as ex_info:
84+
df.sort([])
85+
assert "sort() needs at least one sort expression" in str(ex_info)

0 commit comments

Comments
 (0)