Skip to content

Commit

Permalink
TEST-#4477: add tests for 'df.eval' with scalar and groupby.transofm …
Browse files Browse the repository at this point in the history
…call in the expr

Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Sep 11, 2023
1 parent 0e42667 commit c076f4d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modin/pandas/test/dataframe/test_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,18 @@ def test_eval_df_arithmetic_subexpression():
df_equals(modin_df, df)


def test_eval_groupby_transform():
# see #5511 for details
df = pd.DataFrame({"num": range(1, 1001), "group": ["A"] * 500 + ["B"] * 500})
assert df.eval("num.groupby(group).transform('min')").unique().tolist() == [1, 501]


def test_eval_scalar():
# see #4477 for details
df = pd.DataFrame([[2]])
assert df.eval("1") == 1


TEST_VAR = 2


Expand Down

0 comments on commit c076f4d

Please sign in to comment.