Skip to content

to_iso methods for DatetimeLikeArray #28180

Open
@WillAyd

Description

@WillAyd

to_json (and potentially others) handles the conversion of datetime-like objects to either epoch or isoformats depending on user input. All of this logic is currently housed in the objToJSON.c file and is a major reason why that extension module is rather complex / convoluted.

I think these methods may be general purpose enough to define in a vectorized manner on DatetimeLikeArrays. This wouldn't fully eliminate the need for the objToJSON.c extension module to define serialization for datetimes, timedelta and period object (as items stuck within an object array still need to be serialized), but it would definitely allow it to be more performant and move some of the logic out of the C layer back into Python

@jbrockmendel this is potentially also a precursor to #19486

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeEnhancementIO JSONread_json, to_json, json_normalizeNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions