File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -816,16 +816,18 @@ def test_value_counts_returns_pyarrow_int64(self, data):
816816 result = data .value_counts ()
817817 assert result .dtype == ArrowDtype (pa .int64 ())
818818
819- def test_value_counts_no_numpy_fallback (self , data , arrow_to_numpy_tracker ):
819+ @pytest .mark .parametrize ("normalize" , [False , True ])
820+ def test_value_counts_no_numpy_fallback (
821+ self , data , normalize , arrow_to_numpy_tracker
822+ ):
820823 # Ensure value_counts doesn't unnecessarily convert Arrow arrays to NumPy
821824 data = data [:10 ]
822825 ser = pd .Series (data )
823826
824- ser .value_counts ()
825- assert not arrow_to_numpy_tracker ()
827+ ser .value_counts (normalize = normalize )
826828
827- ser . value_counts ( normalize = True )
828- assert not arrow_to_numpy_tracker ()
829+ numpy_called = arrow_to_numpy_tracker ( )
830+ assert not numpy_called
829831
830832 _combine_le_expected_dtype = "bool[pyarrow]"
831833
You can’t perform that action at this time.
0 commit comments