You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2021/02/27 12:37:00 UTC

[jira] [Updated] (ARROW-6548) [Python] consistently handle conversion of all-NaN arrays across types

     [ https://issues.apache.org/jira/browse/ARROW-6548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joris Van den Bossche updated ARROW-6548:
-----------------------------------------
    Description: 
In ARROW-5682 (https://github.com/apache/arrow/pull/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:

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

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.


  was:
In ARROW-5682 (https://github.com/apache/arrow/pull/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:

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

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.



> [Python] consistently handle conversion of all-NaN arrays across types
> ----------------------------------------------------------------------
>
>                 Key: ARROW-6548
>                 URL: https://issues.apache.org/jira/browse/ARROW-6548
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Joris Van den Bossche
>            Priority: Major
>             Fix For: 4.0.0
>
>
> In ARROW-5682 (https://github.com/apache/arrow/pull/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:
> {code}
> >>> pa.array(np.array([np.nan, np.nan], dtype=float), type=pa.string(), from_pandas=True)
> <pyarrow.lib.StringArray object at 0x7f54dc9de830>
> [
>   null,
>   null
> ]
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)