Skip to content

Fix stale num_rows argument breaking mypy in cudf-polars duplicated-output path - #23303

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:release/26.08from
galipremsagar:cudf-polars-from-table-num-rows
Jul 17, 2026
Merged

Fix stale num_rows argument breaking mypy in cudf-polars duplicated-output path#23303
rapids-bot[bot] merged 1 commit into
NVIDIA:release/26.08from
galipremsagar:cudf-polars-from-table-num-rows

Conversation

@galipremsagar

Copy link
Copy Markdown
Contributor

Description

DataFrame.from_table lost its num_rows parameter in #23234 (row counts are now inferred from the pylibcudf table, which carries them even for zero-column tables), but the duplicated-output path added in #23114 still passes num_rows=0. The two PRs merged around the same time, so this surfaced only after both landed: mypy now fails on every PR's check-style job (engine/core.py:840: Unexpected keyword argument "num_rows"), and the path would raise TypeError at runtime.

plc.copying.empty_like already produces a 0-row table (including for zero-column inputs, verified), so dropping the argument preserves the intended "freshly-allocated empty same-schema frame" semantics exactly.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@galipremsagar
galipremsagar requested a review from a team as a code owner July 16, 2026 19:03
@galipremsagar galipremsagar added bug Something isn't working Python Affects Python cuDF API. non-breaking Non-breaking change cudf-polars Issues specific to cudf-polars labels Jul 16, 2026
@galipremsagar
galipremsagar requested a review from madsbk July 16, 2026 19:03
@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@GPUtester GPUtester moved this to In Progress in cuDF Python Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

drop_if_replicated now creates empty non-root outputs from the original table while preserving column names, dtypes, and execution stream.

Changes

Replicated output handling

Layer / File(s) Summary
Schema-preserving empty frame construction
python/cudf_polars/cudf_polars/engine/core.py
The duplicated-output path uses plc.copying.empty_like and preserves the original DataFrame schema and stream metadata.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • rapidsai/cudf#23234: Both PRs adjust empty DataFrame construction to preserve row or schema information.

Suggested labels: improvement

Suggested reviewers: madsbk, brandon-b-miller, pointkernel, vyasr

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly states the core fix: removing a stale num_rows argument in the cudf-polars duplicated-output path.
Description check ✅ Passed The description matches the change and explains the mypy/runtime issue and why dropping num_rows is correct.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@galipremsagar

Copy link
Copy Markdown
Contributor Author

/okay to test f900238

@galipremsagar

Copy link
Copy Markdown
Contributor Author

/okay to test b4053f6

@galipremsagar
galipremsagar changed the base branch from main to release/26.08 July 17, 2026 01:01
@galipremsagar
galipremsagar requested review from a team as code owners July 17, 2026 01:01
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/okay to test b4053f6

@galipremsagar
galipremsagar changed the base branch from release/26.08 to main July 17, 2026 01:03
…ction

DataFrame.from_table lost its num_rows parameter in NVIDIA#23234 (row counts
are now inferred from the pylibcudf table, which carries them even for
zero-column tables), but the duplicated-output path added in NVIDIA#23114
still passed num_rows=0, breaking mypy on every PR and raising
TypeError at runtime on that path. empty_like already produces a
0-row table (including for zero-column inputs), so the argument was
redundant.
@galipremsagar
galipremsagar changed the base branch from main to release/26.08 July 17, 2026 01:08
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/okay to test 3a35541

@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

@galipremsagar galipremsagar added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Jul 17, 2026
@wence-

wence- commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

/merge

2 similar comments
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

@galipremsagar galipremsagar changed the title Fix stale num_rows argument breaking mypy in cudf-polars duplicated-output path Fix stale num_rows argument breaking mypy in cudf-polars duplicated-output pat Jul 17, 2026
@galipremsagar galipremsagar changed the title Fix stale num_rows argument breaking mypy in cudf-polars duplicated-output pat Fix stale num_rows argument breaking mypy in cudf-polars duplicated-output path Jul 17, 2026
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

@galipremsagar galipremsagar added bug Something isn't working and removed bug Something isn't working labels Jul 17, 2026
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

1 similar comment
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 7b13484 into NVIDIA:release/26.08 Jul 17, 2026
404 of 414 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python Jul 17, 2026
davidwendt pushed a commit to wjxiz1992/cudf that referenced this pull request Jul 21, 2026
…utput path (NVIDIA#23303)

`DataFrame.from_table` lost its `num_rows` parameter in NVIDIA#23234 (row counts are now inferred from the pylibcudf table, which carries them even for zero-column tables), but the duplicated-output path added in NVIDIA#23114 still passes `num_rows=0`. The two PRs merged around the same time, so this surfaced only after both landed: mypy now fails on every PR's `check-style` job (`engine/core.py:840: Unexpected keyword argument "num_rows"`), and the path would raise `TypeError` at runtime.

`plc.copying.empty_like` already produces a 0-row table (including for zero-column inputs, verified), so dropping the argument preserves the intended "freshly-allocated empty same-schema frame" semantics exactly.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)
  - Lawrence Mitchell (https://github.com/wence-)

URL: NVIDIA#23303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working cudf-polars Issues specific to cudf-polars non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants