Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add branch_id to distinguish between reusable branches and pipeline breakers #883

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update
  • Loading branch information
phofl committed Feb 16, 2024
commit 045bbef7f3fa53dda837f87105f59d91e71a658d
5 changes: 1 addition & 4 deletions dask_expr/tests/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2412,10 +2412,7 @@ def test_filter_optimize_condition():

def test_scalar_repr(df):
result = repr(df.size)
assert (
result
== "<dask_expr.expr.Scalar: expr=df.size(_branch_id=BranchId(branch_id=0)), dtype=int64>"
)
assert result == "<dask_expr.expr.Scalar: expr=df.size(), dtype=int64>"


def test_reset_index_filter_pushdown(df):
Expand Down
12 changes: 6 additions & 6 deletions dask_expr/tests/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ def test_groupby_numeric(pdf, df, api, numeric_only, split_every):

def test_groupby_reduction_optimize(pdf, df):
df = df.replace(1, 5)
# agg = df.groupby(df.x).y.sum()
# expected_query = df[["x", "y"]]
# expected_query = expected_query.groupby(expected_query.x).y.sum()
# assert agg.optimize()._name == expected_query.optimize()._name
# expect = pdf.replace(1, 5).groupby(["x"]).y.sum()
# assert_eq(agg, expect)
agg = df.groupby(df.x).y.sum()
expected_query = df[["x", "y"]]
expected_query = expected_query.groupby(expected_query.x).y.sum()
assert agg.optimize()._name == expected_query.optimize()._name
expect = pdf.replace(1, 5).groupby(["x"]).y.sum()
assert_eq(agg, expect)

df2 = df[["y"]]
agg = df2.groupby(df.x).y.sum()
Expand Down