Skip to content

Commit bc7520e

Browse files
committed
Skip timedeltas as they fail with pandas==2.1
pandas-dev/pandas#55080
1 parent c3454d8 commit bc7520e

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

docs/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
ITables ChangeLog
22
=================
33

4+
1.6.0-dev (2023-09-??)
5+
------------------
6+
7+
**Fixed**
8+
- We do not generate timedeltas in the sample dataframes when using `pandas==2.1` as this fails ([pandas-#55080](https://github.com/pandas-dev/pandas/issues/55080))
9+
10+
411
1.5.4 (2023-08-18)
512
------------------
613

itables/sample_dfs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@
3232
"timedelta",
3333
]
3434

35-
PANDAS_VERSION_MAJOR = int(pd.__version__.split(".", 1)[0])
35+
PANDAS_VERSION_MAJOR, PANDAS_VERSION_MINOR, _ = pd.__version__.split(".", 2)
36+
PANDAS_VERSION_MAJOR = int(PANDAS_VERSION_MAJOR)
37+
PANDAS_VERSION_MINOR = int(PANDAS_VERSION_MINOR)
3638
if PANDAS_VERSION_MAJOR == 0:
3739
COLUMN_TYPES = [type for type in COLUMN_TYPES if type != "boolean"]
40+
if PANDAS_VERSION_MAJOR == 2 and PANDAS_VERSION_MINOR == 1:
41+
# https://github.com/pandas-dev/pandas/issues/55080
42+
COLUMN_TYPES = [type for type in COLUMN_TYPES if type != "timedelta"]
3843

3944

4045
def get_countries(html=True):

itables/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""ITables' version number"""
22

3-
__version__ = "1.5.4"
3+
__version__ = "1.6.0+dev"

0 commit comments

Comments
 (0)