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

fix: add polars to requirements.txt for derive_expression example #28

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

cmdlineluser
Copy link
Contributor

I was just experimenting with the new Plugins API example and needed to make a few edits.

make run was failing as polars was missing from requirements.txt so wasn't being installed into the venv

make clean failed due to a typo in the directory name.

The URL for the derive_example in the README.md needed the branch name adjusted. (currently 404)

@ritchie46
Copy link
Member

Thank you. Other than than, were you successful?

@ritchie46 ritchie46 merged commit 0165cb4 into pola-rs:main Oct 2, 2023
2 checks passed
@cmdlineluser
Copy link
Contributor Author

Yes, thanks @ritchie46

It was for a recent "vertical cumfold" question. (similar to pola-rs/polars#7658)

https://stackoverflow.com/questions/77196845/how-to-compute-a-new-polars-column-based-on-its-previous-value

I thought it may be a good opportunity to showcase this new behaviour, so I basically just modified the example you provided: https://github.com/cmdlineluser/polars-plugin-example

It can probably be improved upon with better Rust/Polars-internals knowledge.

Not sure if there is some way to generalize this Iterator::scan() approach for any type.

@ritchie46
Copy link
Member

Not sure if there is some way to generalize this Iterator::scan() approach for any type.

No, you need to specialize it. That's why we don't have a good cumulative story in polars. It is hard to do properly in an interpreted way without paying a huge dynamic dispatch and recompute cost.

Deriving specialized expressions for this is indeed perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants