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/08 09:36:05 UTC
[jira] [Commented] (ARROW-11538) [Python] Seg Fault with
pandas.Timestamp filter
[ https://issues.apache.org/jira/browse/ARROW-11538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17280887#comment-17280887 ]
Joris Van den Bossche commented on ARROW-11538:
-----------------------------------------------
[~josham] thanks a lot for the clear report!
We got a similar report about int96 timestamps (ARROW-11480), but apparently it also happens with nanosecond timestamps (because you are passing {{version="2.0"}}, you save the pandas nanosecond timestamps like that in the parquet file. With the default of {{version="1.0"}}, we convert them to microseconds to write in the parquet file).
> [Python] Seg Fault with pandas.Timestamp filter
> -----------------------------------------------
>
> Key: ARROW-11538
> URL: https://issues.apache.org/jira/browse/ARROW-11538
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 3.0.0
> Environment: platform: Linux 64bit
> conda env:
> conda create -n pya python=3.8 pyarrow=3.0.0 pandas=1.2.1 pytest -c conda-forge
> Reporter: Josh
> Priority: Minor
> Fix For: 4.0.0, 3.0.1
>
>
> The first two tests pass but the third gives: Fatal Python error: Segmentation fault
> All three pass in with pyarrow=2.0.0
> {code:java}
> import pandas
> import pyarrow as pa
> import pyarrow.dataset as ds
> import pyarrow.parquet as pq
> import pytest
> @pytest.fixture
> def data_path(tmp_path):
> path = tmp_path / "data.parquet"
> df = pandas.DataFrame(
> [
> ["A", pandas.Timestamp("2020-11-04")],
> ],
> columns=["name", "date"],
> )
> table = pa.Table.from_pandas(df)
> pq.write_table(table, path, version="2.0")
> return df, path
> @pytest.mark.parametrize(
> "filter",
> [
> None,
> ds.field("date") == "2020-11-04",
> ds.field("date") == pandas.Timestamp("2020-11-04"),
> ],
> )
> def test_dataset_filter(filter, data_path):
> data, path = data_path
> dataset = ds.dataset(path, format="parquet")
> assert data.equals(dataset.to_table(filter=filter).to_pandas())
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)