Skip to content

BUG: read-only buffer failures in datetime parsing #34857

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

PR #22147 caused several "read-only buffer" errors (latest: #34843). I quickly skimmed that PR, and most changes there have been fixed in the mean-time (either converted back to use ndarray or added const), a few are remaining, like:

array_strptime (and also array_to_timedelta64 -> to_timedelta)

In [4]: arr = np.array(['15/10/2020'], dtype=object) 

In [5]: arr.flags.writeable = False   

In [6]: pd.to_datetime(arr, format="%d/%m/%Y")    
...
ValueError: buffer source array is read-only

and then a few in parsing.pyx, but I suppose those are generally not a problem, if the arrays are coming from out parsing code, they will never be read-only.

Originally posted by @jorisvandenbossche in #34843 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions