Registry Mirror
Skip to content

Conversation

@marcus-campbell

@marcus-campbell marcus-campbell commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

The bool branch used rng.integers(0, 1), which always returns 0 because the upper bound is exclusive, so boolean test arrays were entirely False. Changed to rng.integers(0, 2) so they contain a random mix of True and False.

Test-only change; the seeded RNG keeps results deterministic.

Checklist

None applicable. Test-only fix.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR. Tools: OpenAI Codex gpt-5.6-sol (xhigh)

I didn't actually use AI to write any code or comments here, but I technically found this bug during an AI-assisted static analysis project that I've been working on. The AI assisting me was OpenAI Codex gpt-5.6-sol (xhigh). Just stating that for transparency; maintainers, just yell if this disclosure is too pedantic.

rng.integers(0, 1) always returns 0, so boolean DataArrays built by this
test helper contained only False values. Use rng.integers(0, 2) so tests
get a mix of True and False.
@dcherian
dcherian enabled auto-merge (squash) August 18, 2026 21:11
@dcherian
dcherian disabled auto-merge August 19, 2026 20:10
@dcherian
dcherian merged commit d92f931 into pydata:main Aug 19, 2026
39 of 42 checks passed
@welcome

welcome Bot commented Aug 19, 2026

Copy link
Copy Markdown

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

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