Giter VIP home page Giter VIP logo

Comments (3)

stinodego avatar stinodego commented on June 22, 2024 1

Thanks for the report, but this is not an issue with Polars.

The Python docs are really clear about this. DeprecationWarnings are ignored outside the current main.

Also, FutureWarning is not applicable here. It is intended for end users, not for developers. Polars should not throw any FutureWarnings.

If you want to see DeprecationWarnings outside of the main module, you can explicitly opt in to that:

import warnings

warnings.filterwarnings("always", category=DeprecationWarning)

from polars.

ritchie46 avatar ritchie46 commented on June 22, 2024

I am not sure. Users of a library that is written in Polars shouldn't see that deprecation warning. That warning is intended for the developers of that library, not the users up the stack.

from polars.

MarcoGorelli avatar MarcoGorelli commented on June 22, 2024

Sure but like this direct users of Polars who have defined their own convenience functions (e.g. @stfdxv ) risk not seeing the warning

The other extreme is to do what pandas currently does which is to always raise FutureWarning, which is always shown. This is too noisy in my opinion, users see warnings which they can't do anything about.

A middle-ground option, which I'm hoping pandas will move to too (long discussion here pandas-dev/pandas#54970), is:

  • start by raising DeprecationWarning. This will be seen my library developers and end users directly invoking deprecated functions
  • after some time, change it to FutureWarning. This will be visible by everyone, including end users who have defined their own convenience functions (e.g. @stfdxv )
  • finally, enforce the deprecation

Example following the Polars policy:

  • Polars 0.20.11 deprecates pl.col('a').meta.write_json in favour of pl.col('a').meta.serialize, and emits a DeprecationWarning
  • In Polars 1.1.0 (some time in the middle of the 1.x series? When there's a feeling that the next minor release will be the final non-breaking one? Up for discussion), the DeprecationWarning changes to FutureWarning
  • In Polars 2.0.0, Expr.meta.write_json is removed

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.