Skip to content

Closes #5344: ArkoudaExtensionArray.view#5345

Merged
ajpotts merged 3 commits intoBears-R-Us:mainfrom
ajpotts:5344_ArkoudaExtensionArray.view
Jan 27, 2026
Merged

Closes #5344: ArkoudaExtensionArray.view#5345
ajpotts merged 3 commits intoBears-R-Us:mainfrom
ajpotts:5344_ArkoudaExtensionArray.view

Conversation

@ajpotts
Copy link
Contributor

@ajpotts ajpotts commented Jan 26, 2026

Summary
This PR implements view() for ArkoudaExtensionArray, aligning Arkouda’s pandas ExtensionArray behavior with pandas’ expectations around shallow copies. This resolves failures triggered by pandas internals (e.g. BlockManager.copy(deep=False)) that previously raised NotImplementedError.

The new implementation returns a shallow wrapper that shares the same underlying Arkouda server-side data while preserving optional internal metadata. No data is materialized or copied unless an explicit dtype conversion is requested.

Key Changes

  • Implemented ArkoudaExtensionArray.view() with pandas-compatible semantics
  • Delegates to astype(dtype, copy=False) when a different dtype is requested
  • Shares underlying _data while copying optional attributes by reference (_mask, _categories, _codes, _na_value, _cache)
  • Added comprehensive unit tests covering:
    • Shallow-copy semantics
    • Optional attribute handling
    • dtype delegation behavior
    • Regression case for pandas DataFrame construction
  • Improved test diagnostics by replacing print with warnings.warn
  • Minor import cleanup for consistency

Why This Matters
Pandas frequently relies on .view() for shallow copies during internal operations. Without this method, valid workflows (e.g. constructing a DataFrame from a Series backed by Arkouda) could fail unexpectedly. This change restores compatibility without introducing unnecessary data movement.

Testing

  • New targeted unit tests added under tests/pandas/extension
  • All existing tests continue to pass

Backward Compatibility
This is a strict improvement:

  • No API removal
  • No behavior change unless pandas previously hit the unimplemented view() path
  • No additional copying of Arkouda data

Closes #5344: ArkoudaExtensionArray.view

@ajpotts ajpotts added the blocking This is blocking a developer from completing a task they are actively working. label Jan 26, 2026
@ajpotts ajpotts force-pushed the 5344_ArkoudaExtensionArray.view branch from 6fc3bbe to e8982af Compare January 27, 2026 00:14
@ajpotts ajpotts marked this pull request as ready for review January 27, 2026 00:14
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #5345   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         5           
  Lines           ?       109           
  Branches        ?         0           
========================================
  Hits            ?       109           
  Misses          ?         0           
  Partials        ?         0           
Flag Coverage Δ
python-coverage 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.

Copy link
Contributor

@1RyanK 1RyanK left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Contributor

@drculhane drculhane left a comment

Choose a reason for hiding this comment

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

Looks solid.

Copy link
Contributor

@jaketrookman jaketrookman left a comment

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 this pull request to the merge queue Jan 27, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 27, 2026
@ajpotts ajpotts added this pull request to the merge queue Jan 27, 2026
@ajpotts ajpotts force-pushed the 5344_ArkoudaExtensionArray.view branch from e8982af to 3a87580 Compare January 27, 2026 16:50
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 27, 2026
@ajpotts ajpotts merged commit 0fc7e56 into Bears-R-Us:main Jan 27, 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.

ArkoudaExtensionArray.view

4 participants