Skip to content

Commit

Permalink
Fix lambda function in multiindex_strategy to handle str dtypes
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Sugar <[email protected]>
  • Loading branch information
gsugar87 committed Feb 11, 2023
1 parent a9f1c06 commit 1444ce4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pandera/strategies/pandas_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ def multiindex_strategy(
if dtype in {"object", "str"} or dtype.startswith("string"):
# pylint: disable=cell-var-from-loop,undefined-loop-variable
strategy = strategy.map(
lambda df: df.assign(**{name: df[name].map(str)})
lambda df, name=name: df.assign(**{name: df[name].map(str)})
)

if any(nullable_index.values()):
Expand Down

0 comments on commit 1444ce4

Please sign in to comment.