Skip to content

API Change for arithmetic methods for non-pandas objects #17767

Closed
@TomAugspurger

Description

@TomAugspurger

Possible API breakage for dask in #16821

import dask.dataframe as dd
import pandas as pd

from dask.dataframe.utils import assert_eq


s = dd.core.Scalar({('s', 0): 10}, 's', 'i8')
pdf = pd.DataFrame({'a': [1, 2, 3, 4, 5, 6, 7],
                    'b': [7, 6, 5, 4, 3, 2, 1]})
result = (pdf + s).dtypes  # This now casts to object, used to retain int64
expected = pdf.dtypes
assert_eq(result, expected)

In master, result is now (object, object). Before it was (int64, int64).

I'm looking into #16821 to see if this was unintentional, and can be avoided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions