已合并
!4 Fix check dtype assertions for python3-pandas 3.0 #4
!4 Fix check dtype assertions for python3-pandas 3.0 #4
已合并
大漠行舟创建于 8月12日
共 2 个文件变更+49-1
@@ -0,0 +1,44 @@
1+Subject: [PATCH] Fix test dtype assertions for python3-pandas 3.0
2+ 
3+python3-pandas 3.0 changes default datetime64 resolution from ns to us and
4+the default string dtype from object to str, so the upstream test assertions
5+no longer hold on openEuler 26.09. Align the assertions with the actual
6+dtypes produced by pandas 3.0.
7+ 
8+diff --git a/vega_datasets/tests/test_download.py b/vega_datasets/tests/test_download.py
9+--- a/vega_datasets/tests/test_download.py
10++++ b/vega_datasets/tests/test_download.py
11+@@ -29,7 +29,7 @@
12+
13+ def test_stock_date_parsing():
14+ stocks = data.stocks()
15+- assert all(stocks.dtypes == ["object", "datetime64[ns]", "float64"])
16++ assert all(stocks.dtypes == ["str", "datetime64[us]", "float64"])
17+
18+
19+ def test_stock_pivoted():
20+@@ -41,7 +41,7 @@
21+ @skip_if_no_internet
22+ def test_download_stock_parsing():
23+ stocks = data.stocks(use_local=False)
24+- assert all(stocks.dtypes == ["object", "datetime64[ns]", "float64"])
25++ assert all(stocks.dtypes == ["str", "datetime64[us]", "float64"])
26+
27+
28+ @skip_if_no_internet
29+@@ -78,5 +78,5 @@
30+ )
31+ assert all(
32+ zipcodes.dtypes
33+- == ["object", "float64", "float64", "object", "object", "object"]
34++ == ["object", "float64", "float64", "str", "str", "str"]
35+ )
36+diff --git a/vega_datasets/tests/test_local_datasets.py b/vega_datasets/tests/test_local_datasets.py
37+--- a/vega_datasets/tests/test_local_datasets.py
38++++ b/vega_datasets/tests/test_local_datasets.py
39+@@ -84,4 +84,4 @@
40+ ],
41+ )
42+ def test_date_types(name, col):
43+- assert data(name)[col].dtype == "datetime64[ns]"
44++ assert data(name)[col].dtype == "datetime64[us]"
@@ -4,12 +4,13 @@
4 4 
5Name: python-%{pypi_name}5Name: python-%{pypi_name}
6Version: 0.9.06Version: 0.9.0
7-Release: 37+Release: 4
8Summary: A Python package for offline access to vega datasets.8Summary: A Python package for offline access to vega datasets.
9 9 
10License: MIT10License: MIT
11URL: http://github.com/altair-viz/vega_datasets11URL: http://github.com/altair-viz/vega_datasets
12Source0: %{url}/archive/%{version}/%{source_name}-%{version}.tar.gz12Source0: %{url}/archive/%{version}/%{source_name}-%{version}.tar.gz
13+Patch0: 0001-fix-check-error-for-pandas3-dtypes.patch
13BuildArch: noarch14BuildArch: noarch
14 15 
15BuildRequires: python3-devel16BuildRequires: python3-devel
@@ -52,6 +53,9 @@ A Python package for offline access to vega datasets.
52%{python3_sitelib}/vega_datasets53%{python3_sitelib}/vega_datasets
53 54 
54%changelog55%changelog
56+* Wed Aug 12 2026 desert-sailor<dongxing.wang_a@thundersoft.com> - 0.9.0-4
57+- Fix test dtype assertions for python3-pandas 3.0 (datetime64[ns]->datetime64[us], object->str)
58+ 
55* Wed Aug 30 2023 zoujiancang<jczou@isoftstone.com> - 0.9.0-359* Wed Aug 30 2023 zoujiancang<jczou@isoftstone.com> - 0.9.0-3
56- Add check file for the pkg60- Add check file for the pkg
57 61