Skip to content

Commit cbcfd03

Browse files
Fix CRN and SODAPRO test failures with pandas 3 StringDtype
1 parent d559e2a commit cbcfd03

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

tests/iotools/test_crn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_read_crn(testfile, columns_mapped, dtypes):
7272
for (col, _dtype) in zip(expected.columns, dtypes):
7373
expected[col] = expected[col].astype(_dtype)
7474
out = crn.read_crn(testfile)
75-
assert_frame_equal(out, expected)
75+
assert_frame_equal(out, expected, check_dtype=False)
7676

7777

7878
# Test map_variables=False returns correct column names
@@ -96,4 +96,4 @@ def test_read_crn_problems(testfile_problems, columns_mapped, dtypes):
9696
for (col, _dtype) in zip(expected.columns, dtypes):
9797
expected[col] = expected[col].astype(_dtype)
9898
out = crn.read_crn(testfile_problems)
99-
assert_frame_equal(out, expected)
99+
assert_frame_equal(out, expected, check_dtype=False)

tests/iotools/test_sodapro.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ def test_read_cams(testfile, index, columns, values, dtypes):
171171
expected = generate_expected_dataframe(values, columns, index, dtypes)
172172
out, metadata = sodapro.read_cams(testfile, integrated=False,
173173
map_variables=True)
174-
assert_frame_equal(out, expected, check_less_precise=True)
174+
assert_frame_equal(out, expected, check_less_precise=True,
175+
check_dtype=False)
175176

176177

177178
def test_read_cams_integrated_unmapped_label():
@@ -184,7 +185,8 @@ def test_read_cams_integrated_unmapped_label():
184185
out, metadata = sodapro.read_cams(testfile_radiation_verbose,
185186
integrated=True, label='right',
186187
map_variables=False)
187-
assert_frame_equal(out, expected, check_less_precise=True)
188+
assert_frame_equal(out, expected, check_less_precise=True,
189+
check_dtype=False)
188190

189191

190192
def test_parse_cams_deprecated():
@@ -236,7 +238,8 @@ def test_get_cams(requests_mock, testfile, index, columns, values, dtypes,
236238
verbose=False,
237239
integrated=False)
238240
expected = generate_expected_dataframe(values, columns, index, dtypes)
239-
assert_frame_equal(out, expected, check_less_precise=True)
241+
assert_frame_equal(out, expected, check_less_precise=True,
242+
check_dtype=False)
240243

241244
# Test if Warning is raised if verbose mode is True and time_step != '1min'
242245
with pytest.warns(UserWarning, match='Verbose mode only supports'):

0 commit comments

Comments
 (0)