Skip to content

Commit

Permalink
unit test for reproducing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jaychia committed Oct 7, 2022
1 parent 482dc16 commit 4ef5fd1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/dataframe_cookbook/test_explodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ def add_one(o: MyObj):

assert df.schema()["explode"].daft_type == ExpressionType.python_object()

df = df.select(col("explode_plus1"))

assert df.schema()["explode_plus1"].daft_type == ExpressionType.python_object()

pd_df = pd.DataFrame(data)
pd_df = pd_df.explode("explode")
pd_df["explode_plus1"] = pd_df["explode"].apply(add_one)
pd_df = pd_df[["explode_plus1"]]

df.collect()
daft_pd_df = pd.DataFrame(df._result.to_pydict())
Expand Down

0 comments on commit 4ef5fd1

Please sign in to comment.