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

reduce returns a Dask DataFrame, not a NestedFrame #54

Closed
smcguire-cmu opened this issue Sep 13, 2024 · 0 comments · Fixed by #56
Closed

reduce returns a Dask DataFrame, not a NestedFrame #54

smcguire-cmu opened this issue Sep 13, 2024 · 0 comments · Fixed by #56
Assignees
Labels
bug Something isn't working

Comments

@smcguire-cmu
Copy link
Contributor

reduce returns a dask dataframe as its type, not a NestedFrame.

Reproducing example:

import nested_pandas as npd
import numpy as np
import nested_dask as nd
import pandas as pd
import pyarrow as pa

a = npd.NestedFrame({"a": pd.Series([1,2,3], dtype=pd.ArrowDtype(pa.int64()))}, index=[0,0,1])
b = npd.NestedFrame({"b": pd.Series([1,2], dtype=pd.ArrowDtype(pa.int64()))}, index=[0,1])

ndf = b.add_nested(a, name="test")
nddf = nd.NestedFrame.from_pandas(ndf, npartitions=1)

def mean_arr(b, arr):
    return {"b": b, "mean": np.mean(arr)}

reduced = nddf.reduce(mean_arr, "b", "test.a", meta={"b": int, "mean": float})
type(reduced)

Versions:
nested_dask = 0.2.1
nested_pandas = 0.2.2

@smcguire-cmu smcguire-cmu added the bug Something isn't working label Sep 13, 2024
@dougbrn dougbrn self-assigned this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants