Giter VIP home page Giter VIP logo

Comments (6)

stinodego avatar stinodego commented on September 22, 2024 2

Something about support for chrono? Need to get reminder from @stinodego

PyO3 has support for the Python datetime module:
https://pyo3.rs/main/doc/pyo3/types/struct.pydatetime

However, this was never available under the abi3 feature flag.

So we have a bunch of workarounds in place to materialize/read datetime objects. Specially, we have defined Python functions here:
https://github.com/pola-rs/polars/blob/main/py-polars/polars/_utils/convert.py

...that are called from Rust, for example here:

AnyValue::Date(v) => {
let convert = utils.getattr(intern!(py, "to_py_date")).unwrap();
convert.call1((v,)).unwrap().into_py(py)
},

The 0.21 release notes mention:

Extended chrono / datetime conversions, including support for the abi3 feature and the chrono-tz crate

So I am expecting that we can now take advantage of native PyO3 datetime support. And I expect a good performance boost + code cleanup to come from this.

from polars.

itamarst avatar itamarst commented on September 22, 2024 1

0.21.1 is out, so I will start on this either this week or next.

from polars.

itamarst avatar itamarst commented on September 22, 2024 1

I'm gonna say this is done, insofar as it covers the main Polars repository, and the pyo3-polars issue is already filed for that repository.

from polars.

itamarst avatar itamarst commented on September 22, 2024

This is something I can help work on.

from polars.

stinodego avatar stinodego commented on September 22, 2024

Yes we will definitely upgrade to the new PyO3 version when it's released. I had planned to work on that myself but if it's something you're interested in working on I think it's fine if you want to do the honors here.

from polars.

stinodego avatar stinodego commented on September 22, 2024

Thanks a lot for the thorough work @itamarst !

from 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.