Skip to content
Prev Previous commit
Next Next commit
update return type for inplace and update type for resolver
  • Loading branch information
xcz011 committed Jun 24, 2019
commit 1e068b45fb0c5318725a534c740a86261d1e53d1
6 changes: 3 additions & 3 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, List, Optional, Union
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
import warnings

import numpy as np
Expand Down Expand Up @@ -167,7 +167,7 @@ def eval(expr: str,
truediv: bool = True,
local_dict: List[Dict[str, Any]] = None,
global_dict: List[Dict[str, Any]] = None,
resolvers: Iterable = (),
resolvers: Tuple = (),
Copy link
Member

Choose a reason for hiding this comment

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

So does this only accept a Tuple of Dict? If so we want to add Tuple[Dict[?, ?], ...] as the annotation (replacing ? with appropriate types) and update the docstring which currently suggests a list is appropriate

level: int = 0,
target: Union[float, np.ndarray, pd.DataFrame, pd.Series] = None,
inplace: bool = False,
Expand Down Expand Up @@ -367,4 +367,4 @@ def eval(expr: str,
if inplace is False:
return target if target_modified else ret
else:
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't need the else here

return target
return None