Skip to content

[BUG] Nulls render incorrectly in pandas compatibility mode #20673

@vyasr

Description

@vyasr

Describe the bug
In pandas compatibility mode, columns of float type render null entries as "nan" instead of NA.

The value is being produced here. The current rendering seems to have been selected for a specific reason in #19478, perhaps @galipremsagar will remember why. Otherwise we can just open a PR changing that and see what breaks, I'm assuming it'll be one of the pandas tests that we reenabled in that PR and then we can see what we need to do to make the rendering decision more precise.

Steps/Code to reproduce bug

>>> import pandas as pd
>>> import cudf
>>> pd.Series([1, pd.NA])
0       1
1    <NA>
dtype: object
>>> with cudf.option_context("mode.pandas_compatible", True):
...     cudf.Series([1, None], dtype="float")
...
0    1.0
1    nan
dtype: float64
>>> with cudf.option_context("mode.pandas_compatible", False):
...     cudf.Series([1, None], dtype="float")
...
0     1.0
1    <NA>
dtype: float64

Expected behavior
The rendering should be the same as pandas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PythonAffects Python cuDF API.bugSomething isn't workingcudf.pandasIssues specific to cudf.pandas

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions