Comments (6)
@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.
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.
we can just filter the warning and be done with it?
from dask.
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.
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.
#10932 fixes the flaky test
from dask.
Related Issues (20)
- Add a `dask.array.sample` functionality mirroring `dask.dataframe.sample` with an optional `ignore_nan` argument
- Inconsistency in ddf.astype(Arrow Dict) HOT 1
- CI is Failing HOT 4
- ddf.drop is inconsistent when passed a set of columns HOT 4
- test_division_or_partition in test_sql is failing for pandas 3
- Sorting by a categorical column doesn't always work
- Use case focused docs pages HOT 2
- TypeError: can only concatenate str (not "traceback") to str
- ⚠️ Upstream CI failed ⚠️
- Add support for `pip install dask[jobqueue]` HOT 4
- Mean fails to compute for very large column of pyarrow type HOT 1
- Previously working time series resampling breaks in new version of Dask HOT 3
- When using PyArrow dtypes, aggregations create NaNs of unexpected type HOT 1
- Column with object dtype get converted to string when selecting the column HOT 1
- aggregate function that operates on vector(array of numeric) data
- Dask .head() returns error as .compute returns ok! HOT 2
- API docs missing for `read_csv`, `read_fwf` and `read_table` HOT 3
- New CI failure showing up in fsspec HOT 5
- Overlap with `new_axis` option is not trimmed correctly HOT 1
- ValueError: An error occurred while calling the read_csv method registered to the pandas backend HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dask.