Skip to content

Commit 286e2aa

Browse files
committed
COMPAT: Default for inplace is now False in eval
pandas-dev/pandas#11149
1 parent b237ee1 commit 286e2aa

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

dask/dataframe/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,6 +2370,9 @@ def query(self, expr, **kwargs):
23702370

23712371
@derived_from(pd.DataFrame)
23722372
def eval(self, expr, inplace=None, **kwargs):
2373+
if inplace is None:
2374+
if PANDAS_VERSION > '0.21.0':
2375+
inplace = False
23732376
if '=' in expr and inplace in (True, None):
23742377
raise NotImplementedError("Inplace eval not supported."
23752378
" Please use inplace=False")

dask/dataframe/tests/test_dataframe.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,9 +1408,10 @@ def test_eval():
14081408

14091409
# catch FutureWarning from pandas about assignment in eval
14101410
with pytest.warns(None):
1411-
if p.eval('z = x + y', inplace=None) is None:
1412-
with pytest.raises(NotImplementedError):
1413-
d.eval('z = x + y', inplace=None)
1411+
if PANDAS_VERSION < '0.21.0':
1412+
if p.eval('z = x + y', inplace=None) is None:
1413+
with pytest.raises(NotImplementedError):
1414+
d.eval('z = x + y', inplace=None)
14141415

14151416

14161417
@pytest.mark.parametrize('include, exclude', [

0 commit comments

Comments
 (0)