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

Polars: The enum variant Expr::AnonymousFunction cannot be serialized #186

Open
cchudant opened this issue Jan 12, 2023 · 1 comment
Open
Labels
A-client Area: Client C-bug Category: Bug

Comments

@cchudant
Copy link
Contributor

Any usage of value_counts fails with this error:

rdf.select(pl.col("gender").value_counts()).collect().fetch()

Error: ValueError: Error("the enum variant Expr::AnonymousFunction cannot be serialized", line: 0, column: 0)

As @lyie28 told me, this is also the case for these operators:

  • abs()
  • unique_counts()
  • is_finite()
  • is_first()
  • is_inifinite()

Additional context from @lyie28:

I spoke to Lucas about this and it seems this is probably because some Polars functions were implemented using user defined function with lambdas which we can't support, whereas they have updated many of their functions to have a different kind of implementation which we can support. So it might be that with time, Polars updates some of these functions to something we can support anyway, but otherwise, we would need to slowly implement them one by one, probably as torch script implementations (or occasionally it may be possible by combining available Polars methods- like unique().count() instead of unique_counts()). I am working on some other stuff now but might come back to this

Feel free to postpone, or close this issue if this is deemed infeasible – although in this case a better error message would probably be welcome

@cchudant cchudant added A-client Area: Client C-bug Category: Bug labels Jan 12, 2023
@dhalf
Copy link
Contributor

dhalf commented Jan 13, 2023

I suggest we improve error reporting as Charles suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-client Area: Client C-bug Category: Bug
Projects
None yet
Development

No branches or pull requests

2 participants