Skip to content

Fix mypy arg-type for from_buffers after pyarrow-stubs bump - #22979

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
madsbk:pyarrow-stubs-bump-fix
Jun 25, 2026
Merged

Fix mypy arg-type for from_buffers after pyarrow-stubs bump#22979
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
madsbk:pyarrow-stubs-bump-fix

Conversation

@madsbk

@madsbk madsbk commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description

With zen-xu/pyarrow-stubs#284, I started seeing CI errors like:

full log

mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

python/cudf/cudf/core/column/column.py:592: error: Argument 3 to "from_buffers" of "Array" has incompatible type "list[Buffer]"; expected "list[Buffer | None]"  [arg-type]
python/cudf/cudf/core/column/column.py:592: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
python/cudf/cudf/core/column/column.py:592: note: Consider using "Sequence" instead, which is covariant
python/cudf/cudf/core/column/column.py:615: error: Argument 3 to "from_buffers" of "Array" has incompatible type "list[Buffer]"; expected "list[Buffer | None]"  [arg-type]
python/cudf/cudf/core/column/column.py:615: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
python/cudf/cudf/core/column/column.py:615: note: Consider using "Sequence" instead, which is covariant
python/cudf/cudf/core/groupby/groupby.py:573: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
python/cudf/cudf/core/groupby/groupby.py:596: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Found 2 errors in 1 file (checked 615 source files)

@madsbk madsbk self-assigned this Jun 25, 2026
@madsbk madsbk added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jun 25, 2026
@github-actions github-actions Bot added the Python Affects Python cuDF API. label Jun 25, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python Jun 25, 2026
@madsbk

madsbk commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test

@madsbk
madsbk marked this pull request as ready for review June 25, 2026 12:18
@madsbk
madsbk requested a review from a team as a code owner June 25, 2026 12:18
@madsbk
madsbk requested review from Matt711 and bdice June 25, 2026 12:18
@NVIDIA NVIDIA deleted a comment from copy-pr-bot Bot Jun 25, 2026
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ceb46077-024e-4dde-b593-f4f64cc24a9b

📥 Commits

Reviewing files that changed from the base of the PR and between fc8fddb and 3d5aad1.

📒 Files selected for processing (1)
  • python/cudf/cudf/core/column/column.py

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of nested null values when working with struct and list data, helping array reconstruction behave more reliably in edge cases.

Walkthrough

_handle_nulls now types the Arrow buffer slices used to reconstruct nested StructArray and ListArray values as possibly containing None.

Changes

Null reconstruction typing

Layer / File(s) Summary
Struct and list buffer slices
python/cudf/cudf/core/column/column.py
_handle_nulls widens the buffers slice types for struct and list reconstruction from list[pa.Buffer] to list[pa.Buffer | None].

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the mypy type-fix for from_buffers after the pyarrow-stubs bump.
Description check ✅ Passed The description directly matches the changeset and explains the CI mypy errors being fixed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@TomAugspurger

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit f2bc958 into NVIDIA:main Jun 25, 2026
146 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python Jun 25, 2026
@madsbk
madsbk deleted the pyarrow-stubs-bump-fix branch June 25, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants