Git Product home page Git Product logo

Comments (4)

azmyrajab avatar azmyrajab commented on August 28, 2024 1

Hi Karl,

Thank you! Sorry, I totally missed that parameter to register plugin function. It seems it defaults to False for performance reasons (I guess implicitly assuming that most won't use pl.struct in their rust implementations).

In any case, I set it to "True" and my issue seems to have been resolved.

    pass_name_to_apply
        If set to `True`, the `Series` passed to the function in a group-by operation
        will ensure the name is set. This is an extra heap allocation per group.

I will close this issue as setting to True works for my usecase

from pyo3-polars.

azmyrajab avatar azmyrajab commented on August 28, 2024

Hello! would it be possible to ask for a rough ETA for something like this to be fixed? Unfortunately I'm not familiar enough with the codebase to know where to look - but happy to try a PR if someone can provide guidance

Unf this is causing inconsistent behaviour in my pl.Struct outputs in the meantime

from pyo3-polars.

cmdlineluser avatar cmdlineluser commented on August 28, 2024

There was a recent issue where this was fixed in Polars for qcut: pola-rs/polars#15715 (input name "empty" in a groupby context)

It seems this is controlled via the FunctionOptions pass_name_to_apply

            if self.pass_name_to_apply {
                s.rename(&name);
            }

It seems that register_plugin_function also has this option which should fix this.

register_plugin_function(
    ...,
    pass_name_to_apply=True
)

(I'm not sure why it defaults to False - perhaps someone with more knowledge can answer that.)

from pyo3-polars.

cmdlineluser avatar cmdlineluser commented on August 28, 2024

for performance reasons

Ah! I didn't realize the function had its own docs page.

It seems like something that could be added to the User Guide or to @MarcoGorelli's Plugin Tutorial - as it could be considered a bit of a "gotcha".

from pyo3-polars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.