Skip to content

Commit 77483dd

Browse files
committed
ERR: correctly raise ValueError on empty input to pd.eval() and df.query() (pandas-dev#13139)
1 parent 9a5c55f commit 77483dd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/whatsnew/v0.19.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ Bug Fixes
5757

5858
- Bug in ``pd.pivot_table`` may raise ``TypeError`` or ``ValueError`` when ``index`` or ``columns``
5959
is not scalar and ``values`` is not specified (:issue:`14380`)
60-
- pd.eval('') and df.query('') now show better error message and raise ``ValueError`` (:issue: `13139`)
60+
- corrrecly raise ``ValueError`` on empty input to pd.eval() and df.query() (:issue: `13139`)

pandas/computation/tests/test_eval.py

+1
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,7 @@ def test_bad_resolver_raises():
18921892

18931893

18941894
def check_empty_string_raises(engine, parser):
1895+
# GH 13139
18951896
tm.skip_if_no_ne(engine)
18961897
with tm.assertRaisesRegexp(ValueError, 'expr cannot be an empty string'):
18971898
pd.eval('', engine=engine, parser=parser)

0 commit comments

Comments
 (0)