Skip to content

BUG: pyarrow engine timestamp conversion fails when doing pd.read_csv #65308

@pradipneupane

Description

@pradipneupane

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
import io

csv_data = """time
2026-04-20 10:00:00
2026-04-20 10:05:00
2026-04-20 10:10:00
"""

df = pd.read_csv(
    io.StringIO(csv_data),
    engine="pyarrow",
)

df['time'] = pd.to_datetime(df['time'])
df['time'] = df['time'].astype('int64')
df['time'] = pd.to_datetime(df['time'], unit='ns')
print(df)

Issue Description

from above example; it prints but if engine is set to python, then it works correctly:

                           time
0 1970-01-01 00:00:01.776679200
1 1970-01-01 00:00:01.776679500
2 1970-01-01 00:00:01.776679800

Expected Behavior

it should give:

                 time
0 2026-04-20 10:00:00
1 2026-04-20 10:05:00
2 2026-04-20 10:10:00

Installed Versions

it still exist in latest version of pandas and in 2.3.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions