Skip to content

Normalize pandas Series conversion in from_series #5351

Closed

Description

@ajpotts

Context

The from_series conversion path in arkouda.pandas.conversion.from_series
has historically been sensitive to pandas dtype variations, particularly for
string and datetime/timedelta types. Recent changes improve robustness and
correctness by normalizing dtype interpretation and explicitly handling
time-like types with non-nanosecond resolutions.

Changes Included

  1. String dtype normalization

    • Treat multiple pandas dtype spellings as a single "string" dtype:
      • object
      • str
      • string[python]
      • string[pyarrow]
    • Reduces special-case behavior and aligns conversion with modern pandas expectations.
  2. Datetime / Timedelta resolution handling

    • Explicitly detects datetime (kind == "M") and timedelta (kind == "m") Series.
    • Accepts any resolution (us, ms, ns, etc.).
    • Normalizes values to nanoseconds and converts to int64 before creating the Arkouda array.
    • Eliminates failures when Series use non-ns resolutions.
  3. Improved failure modes

    • Prevents KeyError caused by narrow dtype mappings.
    • Makes from_series behavior consistent across pandas versions and backends.

Motivation

These changes address observed failures when converting:

  • Series with pandas string dtype variants
  • Datetime/timedelta Series using non-nanosecond resolutions

The update makes these cases first-class and reduces surprises for users
working with mixed pandas data.

Acceptance Criteria

  • from_series correctly converts Series with all supported pandas string dtype spellings.
  • Datetime and timedelta Series with any resolution convert without error.
  • Behavior is consistent across pandas versions and backends.

Activity

  1. self-assigned this
    on Jan 27, 2026
  2. added a commit that references this issue on Jan 28, 2026
    d2a464d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions