Skip to content

Commit 5bf7b18

Browse files
authored
Fix tests broken by pandas 2.3 (#774)
1 parent f55883f commit 5bf7b18

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

tests/integration/reports/multi_table/test_quality_report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ def test_quality_report_with_errors():
302302
})
303303

304304
pandas_version = version.parse(pd.__version__)
305-
if pandas_version >= version.parse('2.2.0'):
305+
if pandas_version >= version.parse('2.3.0'):
306+
err1 = err2 = err3 = 'TypeError: Expected numeric dtype, got object instead.'
307+
elif pandas_version >= version.parse('2.2.0'):
306308
err1 = "TypeError: '<' not supported between instances of 'int' and 'str'"
307309
err2 = "TypeError: '<' not supported between instances of 'Timestamp' and 'str'"
308310
err3 = "TypeError: '<' not supported between instances of 'float' and 'str'"

tests/integration/reports/single_table/_properties/test_column_shapes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ def test_get_score_errors(self):
8989

9090
# Assert
9191
pandas_version = version.parse(pd.__version__)
92-
if pandas_version >= version.parse('2.2.0'):
92+
if pandas_version >= version.parse('2.3.0'):
93+
expected_message_1 = expected_message_2 = (
94+
'TypeError: Expected numeric dtype, got object instead.'
95+
)
96+
elif pandas_version >= version.parse('2.2.0'):
9397
expected_message_1 = (
9498
"TypeError: '<' not supported between instances of 'Timestamp' and 'int'"
9599
)

tests/unit/reports/single_table/_properties/test_column_shapes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ def test__generate_details_error(self):
110110

111111
# Assert
112112
pandas_version = version.parse(pd.__version__)
113-
if pandas_version >= version.parse('2.2.0'):
113+
if pandas_version >= version.parse('2.3.0'):
114+
expected_message = 'TypeError: Expected numeric dtype, got object instead.'
115+
elif pandas_version >= version.parse('2.2.0'):
114116
expected_message = "TypeError: '<' not supported between instances of 'str' and 'int'"
115117
else:
116118
expected_message = "TypeError: can't multiply sequence by non-int of type 'float'"

0 commit comments

Comments
 (0)