Skip to content
Prev Previous commit
Next Next commit
update type hint to fix CI
  • Loading branch information
xcz011 committed Jun 24, 2019
commit 0263816116ab71cb15c7934e35b5cd7ae0a04b96
9 changes: 5 additions & 4 deletions pandas/core/computation/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

import tokenize
from typing import Any, Dict, Iterable, Union
from typing import Any, Dict, Iterable, List, Optional, Union
import warnings

import numpy as np
Expand All @@ -19,7 +19,7 @@
from pandas.io.formats.printing import pprint_thing


def _check_engine(engine: str) -> str:
def _check_engine(engine: Optional[str]) -> str:
"""
Make sure a valid engine is passed.

Expand Down Expand Up @@ -158,14 +158,15 @@ def _check_for_locals(expr: str, stack_level: int, parser: str) -> None:
for toknum, tokval in tokenize_string(expr):
if toknum == tokenize.OP and tokval == '@':
raise SyntaxError(msg)
return None


def eval(expr: str,
parser: str = 'pandas',
engine: str = None,
truediv: bool = True,
local_dict: Dict[str, Any] = None,
global_dict: Dict[str, Any] = None,
local_dict: List[Dict[str, Any]] = None,
global_dict: List[Dict[str, Any]] = None,
resolvers: Iterable = (),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be List[Dict] per documentation (may also help CI failure)

level: int = 0,
target: Union[float, np.ndarray, pd.DataFrame, pd.Series] = None,
Expand Down