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

BUG: Reduction UDF returning np.array hits error when used in grouped aggregation #2770

Merged
merged 10 commits into from
May 10, 2021

Conversation

timothydijamco
Copy link
Contributor

Closes #2768

# Using `apply` as a workaround for the fact that
# `SeriesGroupBy.agg` does not allow np.arrays to be returned
# from UDFs.
return grouped_data.apply(wrap_for_agg(function, args, kwargs))
Copy link
Contributor

Choose a reason for hiding this comment

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

In what case we want to exercise the "else" branch here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is when exercised when doing an ungrouped aggregation, e.g. my_arr_col.collect()

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

can you add a release note as well

ibis/backends/dask/tests/test_udf.py Show resolved Hide resolved
ibis/backends/pandas/tests/test_udf.py Show resolved Hide resolved
@jreback jreback added bug Incorrect behavior inside of ibis expressions Issues or PRs related to the expression API labels May 10, 2021
@jreback jreback added this to the Next release milestone May 10, 2021
@jreback jreback added the udf Issues related to user-defined functions label May 10, 2021
@jreback jreback merged commit cd7ec99 into ibis-project:master May 10, 2021
@cpcloud cpcloud removed this from the Next release milestone Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis expressions Issues or PRs related to the expression API udf Issues related to user-defined functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Reduction UDF returning np.array hits error when used in grouped aggregation
4 participants