File: value_counts_nat_numpy2.patch

package info (click to toggle)
pandas 2.2.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,784 kB
  • sloc: python: 422,228; ansic: 9,190; sh: 270; xml: 102; makefile: 83
file content (19 lines) | stat: -rw-r--r-- 698 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Avoid test crash

First seen on numpy2 transition, unknown if actually related to that

Author: Matthew Roeschke
Origin: upstream pull 60416
Forwarded: not-needed

--- a/pandas/tests/test_algos.py
+++ b/pandas/tests/test_algos.py
@@ -1281,7 +1281,7 @@ class TestValueCounts:
             result_dt = algos.value_counts(dt)
         tm.assert_series_equal(result_dt, exp_dt)
 
-        exp_td = Series({np.timedelta64(10000): 1}, name="count")
+        exp_td = Series([1], index=[np.timedelta64(10000)], name="count")
         with tm.assert_produces_warning(FutureWarning, match=msg):
             result_td = algos.value_counts(td)
         tm.assert_series_equal(result_td, exp_td)