Skip to content

Closes #5351: Normalize pandas Series conversion in from_series - #5352

Merged
ajpotts merged 1 commit into
Bears-R-Us:mainfrom
ajpotts:5351_Normalize_pandas_Series_conversion_in_from_series
Jan 28, 2026
Merged

ajpotts merged 1 commit into
Bears-R-Us:mainfrom
ajpotts:5351_Normalize_pandas_Series_conversion_in_from_series

Conversation

@ajpotts

@ajpotts ajpotts commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR improves ak.from_series to better align with pandas expectations and real-world usage by:

  1. Supporting datetime and timedelta Series at any resolution (ns, us, ms, etc.)
  2. Normalizing pandas string dtype spellings to Arkouda Strings
  3. Clarifying and expanding the function docstring, with executable examples
  4. Adding doctest coverage and targeted unit tests for new behavior

Motivation

Previously, from_series only reliably handled datetime64[ns] and a narrow set of string dtype spellings. In practice, pandas Series often contain:

  • Datetime or timedelta data with non-nanosecond resolutions
  • Multiple equivalent string dtype spellings (object, string[pyarrow], etc.)

This PR makes from_series more robust, more pandas-compatible, and easier to understand and validate.


Behavior Changes

Datetime / Timedelta Handling

  • Any pandas datetime or timedelta Series is now accepted regardless of resolution
  • Values are normalized to int64 nanoseconds, consistent with Arkouda conventions

Examples:

ak.from_series(pd.Series([np.datetime64("2018-01-01", "ms")]))
ak.from_series(pd.Series([np.timedelta64(123, "ms")]))

Closes #5351: Normalize pandas Series conversion in from_series

@ajpotts
ajpotts force-pushed the 5351_Normalize_pandas_Series_conversion_in_from_series branch from 7be0839 to 3682f35 Compare January 27, 2026 18:57
@ajpotts
ajpotts marked this pull request as ready for review January 27, 2026 19:03
@ajpotts
ajpotts force-pushed the 5351_Normalize_pandas_Series_conversion_in_from_series branch from 3682f35 to 5c25eb9 Compare January 27, 2026 19:19

@jaketrookman jaketrookman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@ajpotts ajpotts added the blocking This is blocking a developer from completing a task they are actively working. label Jan 27, 2026

@1RyanK 1RyanK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment thread arkouda/pandas/conversion.py Resolved
@ajpotts
ajpotts force-pushed the 5351_Normalize_pandas_Series_conversion_in_from_series branch from a278b52 to 40463ff Compare January 28, 2026 15:28
@codecov

codecov Bot commented Jan 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@0fc7e56). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #5352   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         5           
  Lines           ?       115           
  Branches        ?         0           
========================================
  Hits            ?       115           
  Misses          ?         0           
  Partials        ?         0           
Flag Coverage Δ
python-coverage 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ajpotts
ajpotts enabled auto-merge January 28, 2026 17:18
@ajpotts
ajpotts added this pull request to the merge queue Jan 28, 2026
Merged via the queue into Bears-R-Us:main with commit d2a464d Jan 28, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocking This is blocking a developer from completing a task they are actively working.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize pandas Series conversion in from_series

3 participants