Skip to content

Commit c8f4cce

Browse files
committed
fix error msg tests for pandas dataframes
1 parent 331c929 commit c8f4cce

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

doubleml/irm/tests/test_apo_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_apo_exception_data():
2525
msg = (
2626
r"The data must be of DoubleMLData or DoubleMLClusterData or DoubleMLDIDData or DoubleMLSSMData or "
2727
r"DoubleMLRDDData type\. Empty DataFrame\nColumns: \[\]\nIndex: \[\] of type "
28-
r"<class 'pandas\.core\.frame\.DataFrame'> was passed\."
28+
r"<class 'pandas\.DataFrame'> was passed\."
2929
)
3030
with pytest.raises(TypeError, match=msg):
3131
_ = DoubleMLAPO(pd.DataFrame(), ml_g, ml_m, treatment_level=0)

doubleml/irm/tests/test_ssm_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_ssm_exception_data():
3535
msg = (
3636
r"The data must be of DoubleMLData or DoubleMLClusterData or DoubleMLDIDData or DoubleMLSSMData or "
3737
r"DoubleMLRDDData type\. Empty DataFrame\nColumns: \[\]\nIndex: \[\] of type "
38-
r"<class 'pandas\.core\.frame\.DataFrame'> was passed\."
38+
r"<class 'pandas\.DataFrame'> was passed\."
3939
)
4040
with pytest.raises(TypeError, match=msg):
4141
_ = DoubleMLSSM(pd.DataFrame(), ml_g, ml_pi, ml_m)

doubleml/plm/tests/test_lplr_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
@pytest.mark.ci
2525
def test_lplr_exception_data():
26-
msg = r"The data must be of DoubleMLData.* type\.[\s\S]* of type " r"<class 'pandas\.core\.frame\.DataFrame'> was passed\."
26+
msg = r"The data must be of DoubleMLData.*type\."
2727
with pytest.raises(TypeError, match=msg):
2828
_ = DoubleMLLPLR(pd.DataFrame(), ml_M, ml_t, ml_m)
2929

doubleml/plm/tests/test_plpr_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
@pytest.mark.ci
6363
def test_plpr_exception_data():
64-
msg = "The data must be of DoubleMLPanelData type. <class 'pandas.core.frame.DataFrame'> was passed."
64+
msg = "The data must be of DoubleMLPanelData type. <class 'pandas.DataFrame'> was passed."
6565
with pytest.raises(TypeError, match=msg):
6666
_ = dml.DoubleMLPLPR(pd.DataFrame(), ml_l, ml_m)
6767
# not a panel data object

doubleml/utils/tests/test_policytree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def test_doubleml_exception_policytree():
9898
with pytest.raises(TypeError, match=msg):
9999
dml_policytree_predict.predict(features=1)
100100
msg = (
101-
r"The features must have the keys Index\(\[\'a\', \'b\', \'c\'\], dtype\=\'object\'\). "
102-
r"Features with keys Index\(\[\'d\'\], dtype=\'object\'\) were passed."
101+
r"The features must have the keys Index\(\[\'a\', \'b\', \'c\'\], dtype\=\'str\'\). "
102+
r"Features with keys Index\(\[\'d\'\], dtype=\'str\'\) were passed."
103103
)
104104
with pytest.raises(KeyError, match=msg):
105105
dml_policytree_predict.predict(features=pd.DataFrame({"d": [3, 4]}))

0 commit comments

Comments
 (0)