Giter Club home page Giter Club logo

Comments (6)

crusaderky avatar crusaderky commented on May 26, 2024

@jrbourbeau @phofl how should we deal with this? It's impossible to replicate pandas' current (and deprecated) behaviour, as it would require us to eagerly compute everything until that moment for lhs in order to determine its dtype:

out.dtype = dd.isna(lhs).all().compute() ? rhs.dtype : lhs.dtype

The current behaviour (which I'm not too excited about) is to have out.dtype = in.dtype for the dask collection and to match pandas for the computed output; in other words out.dtype != out.compute().dtype.
There may however be FutureWarnings that don't happen in pandas as the isna(lhs).all() is tested individually for every chunk (the PR linked below makes a trivial example).
For datetime64, the current behaviour is to always return lhs.dtype, which differs from pandas.

One option is to quietly perform rhs.astype(lhs.dtype); this means that dask will change its output overnight to what's going to be in pandas 3.0(?).
Another option is do nothing, which means dask will keep occasionally producing spurious FutureWarnings and/or have mismatched dtype at times.

from dask.

crusaderky avatar crusaderky commented on May 26, 2024

A third option is to print a RuntimeWarning at graph definition time every time lhs.dtype != rhs.dtype, and then implement pandas 3's behaviour of sticking with lhs.dtype.

from dask.

phofl avatar phofl commented on May 26, 2024

we can just filter the warning and be done with it?

from dask.

crusaderky avatar crusaderky commented on May 26, 2024

we can just filter the warning and be done with it?

that would mean that out.compute().dtype != out.dtype, and that the output dtype will change overnight when the user upgrades to pandas 3.

from dask.

phofl avatar phofl commented on May 26, 2024

that would mean that out.compute().dtype != out.dtype

This happens in multiple places, I wouldn't worry too much about it.

that the output dtype will change overnight when the user upgrades to pandas 3.

Not great but could be worse imo.

I wouldn't spend too much time on this, having all nan partitions in this combination is not something that is very likely and combine_first is not used much in the pandas space

from dask.

crusaderky avatar crusaderky commented on May 26, 2024

#10932 fixes the flaky test

from dask.

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.