Skip to content

Closes #5312: ExtensionArray.isna return type to match pandas - #5313

Merged
ajpotts merged 1 commit into
Bears-R-Us:mainfrom
ajpotts:5312_ExtensionArray.isna_return_type_to_match_pandas
Jan 15, 2026
Merged

ajpotts merged 1 commit into
Bears-R-Us:mainfrom
ajpotts:5312_ExtensionArray.isna_return_type_to_match_pandas

Conversation

@ajpotts

@ajpotts ajpotts commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor

Fix isna return type to match pandas ExtensionArray contract

Summary

This PR fixes a mypy override error in ArkoudaArray.isna by aligning its return type with the
pandas.core.arrays.base.ExtensionArray API. The method now always returns a NumPy boolean ndarray
instead of sometimes returning an Arkouda-backed array.

Motivation

ExtensionArray.isna() is required by pandas to return a NumPy bool ndarray. Returning an
ExtensionArray violates the base-class contract and causes mypy to emit an override error.

Changes

  • Update the isna signature to return NDArray[np.bool_].
  • Convert the Arkouda isnan result to a NumPy boolean array before returning.
  • Update the corresponding test to expect a NumPy array rather than an Arkouda array.

Impact

  • Resolves mypy override error.
  • Brings Arkouda’s pandas ExtensionArray implementation into strict compliance with pandas’ API.
  • No behavioral change for users beyond the concrete return type of isna.

Testing

  • Updated unit test verifies that isna() returns a NumPy boolean array with correct values.

Closes #5312: ExtensionArray.isna return type to match pandas

@ajpotts ajpotts added the blocking This is blocking a developer from completing a task they are actively working. label Jan 15, 2026
@ajpotts
ajpotts marked this pull request as ready for review January 15, 2026 12:48
@codecov

codecov Bot commented Jan 15, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #5313   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         4           
  Lines           ?        63           
  Branches        ?         0           
========================================
  Hits            ?        63           
  Misses          ?         0           
  Partials        ?         0           

☔ 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.

@drculhane drculhane 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 very straightforward.

@ajpotts
ajpotts force-pushed the 5312_ExtensionArray.isna_return_type_to_match_pandas branch from 51a59dc to e94c3f8 Compare January 15, 2026 14:52
@ajpotts
ajpotts enabled auto-merge January 15, 2026 14:53

@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!

@ajpotts
ajpotts force-pushed the 5312_ExtensionArray.isna_return_type_to_match_pandas branch from c5d39fb to 7a644f3 Compare January 15, 2026 17:08
@ajpotts
ajpotts force-pushed the 5312_ExtensionArray.isna_return_type_to_match_pandas branch from 7a644f3 to 6971080 Compare January 15, 2026 17:12
@ajpotts
ajpotts added this pull request to the merge queue Jan 15, 2026
Merged via the queue into Bears-R-Us:main with commit 983fc7a Jan 15, 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.

ExtensionArray.isna return type to match pandas

4 participants