@@ -1105,40 +1105,6 @@ def test_single_variable(self):
1105
1105
df2 = self .eval ("df" , local_dict = {"df" : df })
1106
1106
tm .assert_frame_equal (df , df2 )
1107
1107
1108
- def test_truediv (self ):
1109
- s = np .array ([1 ]) # noqa:F841
1110
- ex = "s / 1"
1111
-
1112
- # FutureWarning: The `truediv` parameter in pd.eval is deprecated and will be
1113
- # removed in a future version.
1114
- with tm .assert_produces_warning (FutureWarning ):
1115
- res = self .eval (ex , truediv = False )
1116
- tm .assert_numpy_array_equal (res , np .array ([1.0 ]))
1117
-
1118
- with tm .assert_produces_warning (FutureWarning ):
1119
- res = self .eval (ex , truediv = True )
1120
- tm .assert_numpy_array_equal (res , np .array ([1.0 ]))
1121
-
1122
- with tm .assert_produces_warning (FutureWarning ):
1123
- res = self .eval ("1 / 2" , truediv = True )
1124
- expec = 0.5
1125
- assert res == expec
1126
-
1127
- with tm .assert_produces_warning (FutureWarning ):
1128
- res = self .eval ("1 / 2" , truediv = False )
1129
- expec = 0.5
1130
- assert res == expec
1131
-
1132
- with tm .assert_produces_warning (FutureWarning ):
1133
- res = self .eval ("s / 2" , truediv = False )
1134
- expec = 0.5
1135
- assert res == expec
1136
-
1137
- with tm .assert_produces_warning (FutureWarning ):
1138
- res = self .eval ("s / 2" , truediv = True )
1139
- expec = 0.5
1140
- assert res == expec
1141
-
1142
1108
def test_failing_subscript_with_name_error (self ):
1143
1109
df = DataFrame (np .random .randn (5 , 3 )) # noqa:F841
1144
1110
with pytest .raises (NameError , match = "name 'x' is not defined" ):
@@ -1859,23 +1825,6 @@ def test_inf(engine, parser):
1859
1825
assert result == expected
1860
1826
1861
1827
1862
- def test_truediv_deprecated (engine , parser ):
1863
- # GH#29182
1864
- match = "The `truediv` parameter in pd.eval is deprecated"
1865
-
1866
- with tm .assert_produces_warning (FutureWarning ) as m :
1867
- pd .eval ("1+1" , engine = engine , parser = parser , truediv = True )
1868
-
1869
- assert len (m ) == 1
1870
- assert match in str (m [0 ].message )
1871
-
1872
- with tm .assert_produces_warning (FutureWarning ) as m :
1873
- pd .eval ("1+1" , engine = engine , parser = parser , truediv = False )
1874
-
1875
- assert len (m ) == 1
1876
- assert match in str (m [0 ].message )
1877
-
1878
-
1879
1828
@pytest .mark .parametrize ("column" , ["Temp(°C)" , "Capacitance(μF)" ])
1880
1829
def test_query_token (engine , column ):
1881
1830
# See: https://github.com/pandas-dev/pandas/pull/42826
0 commit comments