Skip to content

[Python] consistently handle conversion of all-NaN arrays across types #22909

Description

@asfimport

In ARROW-5682 (#5333), next to fixing actual conversion bugs, I added the ability to convert all-NaN float arrays when converting to string type (and only with from_pandas=True). So this now works:

>>> pa.array(np.array([np.nan, np.nan], dtype=float), type=pa.string(), from_pandas=True)
<pyarrow.lib.StringArray object at 0x7f54dc9de830>
[
  null,
  null
]

However, I only added this for string type (and it already works for float and int types). If we are happy with this behaviour, we should also add it for other types.

Reporter: Joris Van den Bossche / @jorisvandenbossche

Note: This issue was originally created as ARROW-6548. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions