Avoid test crash
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sat, 29 Mar 2025 13:01:52 +0000 (13:01 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sat, 29 Mar 2025 13:01:52 +0000 (13:01 +0000)
First seen on numpy2 transition, unknown if actually related to that

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

Gbp-Pq: Name value_counts_nat_numpy2.patch

pandas/tests/test_algos.py

index 9f0a197c6ba68e75c13ac2a3503fd1c18d486bbb..a7873be3dcc1885d8b9595bc8f31296343fcb558 100644 (file)
@@ -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)