Skip to content

BUG: Series.dt.isocalendar returns 0 instead of NA for missing ArrowDtype values - #1924

Open
xirafa wants to merge 1 commit into
mainfrom
tydavid5/fix/arrow-isocalendar-na
Open

xirafa wants to merge 1 commit into
mainfrom
tydavid5/fix/arrow-isocalendar-na

Conversation

@xirafa

@xirafa xirafa commented Nov 19, 2026

Copy link
Copy Markdown

Mirror of pandas-dev/pandas#72243. Runs the pandas test suite through dagz.

…type values

For an ArrowDtype timestamp Series, Series.dt.isocalendar replaced missing values with 0 in all three columns, while the NumPy backed equivalent returns NA. The struct array returned by pyarrow.compute.iso_calendar marks missing rows in its own null bitmap, but its child arrays hold 0 with no nulls, and taking the columns with field(i) ignored that bitmap.

The columns are now built from flatten() instead, which applies the parent validity to the child arrays, so missing rows come back as NA and valid rows are unchanged. The result dtypes are unchanged.

Closes #72217
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dd77c2b5-01c8-4463-92be-590dab9f6e67
Commits

Reviewing files that changed from the base of the PR and between 42cbbed and 85a2217.

Files selected for processing: 3

  • doc/source/whatsnew/v3.2.0.rst
  • pandas/core/indexes/accessors.py
  • pandas/tests/arrays/arrow/test_datetimelike.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

2 participants