Skip to content

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

Open
ajpotts wants to merge 1 commit intoBears-R-Us:mainfrom
ajpotts:5413_bug_in_pd.array_when_dtype_is_ak.bigint
Open

Closes #5413: bug in pd.array when dtype is ak.bigint#5414
ajpotts wants to merge 1 commit intoBears-R-Us:mainfrom
ajpotts:5413_bug_in_pd.array_when_dtype_is_ak.bigint

Conversation

@ajpotts
Copy link
Contributor

@ajpotts ajpotts commented Feb 13, 2026

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 from 318a138 to 7d218a9 Compare February 13, 2026 22:58
@ajpotts ajpotts force-pushed the 5413_bug_in_pd.array_when_dtype_is_ak.bigint branch from 7d218a9 to 778f511 Compare February 13, 2026 23:36
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

1 participant