Skip to content

Closes #5413: bug in pd.array when dtype is ak.bigint - #5414

Merged
ajpotts merged 2 commits into
Bears-R-Us:mainfrom
ajpotts:5413_bug_in_pd.array_when_dtype_is_ak.bigint
Feb 19, 2026
Merged

ajpotts merged 2 commits into
Bears-R-Us:mainfrom
ajpotts:5413_bug_in_pd.array_when_dtype_is_ak.bigint

Conversation

@ajpotts

@ajpotts ajpotts commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes a bug where constructing a pandas ExtensionArray from an
existing Arkouda bigint pdarray using:

pd.array(a, dtype="ak.bigint")

would incorrectly attempt a server-side cast:

cast<bigint,object,1>

which fails because Arkouda does not support casting bigint to
object.


Root Cause

Inside ArkoudaArray._from_sequence, when pandas passed an
ArkoudaBigintDtype, the implementation converted it to its NumPy
equivalent (object).

This caused:

  1. ak.array(existing_bigint_pdarray, dtype=object)
  2. Which triggered ak.cast(..., object)
  3. Resulting in an unsupported backend command: cast<bigint,object,1>

Fix

Special-case ArkoudaBigintDtype in _from_sequence so that:

  • "bigint" is passed directly to ak.array
  • No conversion to NumPy object occurs
  • No unnecessary server-side cast is attempted

All other Arkouda dtypes continue to use their NumPy equivalents as
before.


Test Coverage

Adds regression test:

test_pd_array_construct_from_ak_bigint_pdarray_explicit_dtype_does_not_cast_to_object

This test verifies:

  • Construction succeeds without server error
  • The resulting array is Arkouda-backed
  • Values are preserved
  • The dtype remains bigint (allowing alias tolerance)

This would have failed prior to this fix with a RuntimeError.


Impact

  • Fixes explicit ak.bigint dtype construction
  • Prevents invalid backend cast commands
  • Improves pandas interoperability for Arkouda bigint arrays
  • No breaking changes

Closes #5413: bug in pd.array when dtype is ak.bigint

@ajpotts
ajpotts marked this pull request as ready for review February 13, 2026 22:57
@ajpotts
ajpotts force-pushed the 5413_bug_in_pd.array_when_dtype_is_ak.bigint branch 2 times, most recently from 7d218a9 to 778f511 Compare February 13, 2026 23:36

@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 force-pushed the 5413_bug_in_pd.array_when_dtype_is_ak.bigint branch from 778f511 to e264e0d Compare February 18, 2026 19:32
@ajpotts
ajpotts merged commit cf8d47a into Bears-R-Us:main Feb 19, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug in pd.array when dtype is ak.bigint

2 participants