Skip to content

GH-55921: [C++] Validate multiple > 0 in temporal rounding kernels - #55963

Open
rok wants to merge 1 commit into
apache:mainfrom
rok:gh-55921-round-temporal-multiple
Open

rok wants to merge 1 commit into
apache:mainfrom
rok:gh-55921-round-temporal-multiple

Conversation

@rok

@rok rok commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Rationale for this change

floor_temporal, ceil_temporal, and round_temporal crash with division by zero when multiple=0 and produce invalid results when multiple < 0.

What changes are included in this PR?

Kernel initialization now validates multiple > 0 during kernel initialization for floor_temporal, ceil_temporal, and round_temporal, returning Status::Invalid in case multiple <= 0. This also adds C++ and Python test cases for multiple <= 0.

Are these changes tested?

Yes, C++ and Python unit tests are added.

Are there any user-facing changes?

floor_temporal, ceil_temporal, and round_temporal now return an invalid status when multiple <= 0.

This PR contains a "Critical Fix". Fixes a division-by-zero crash for multiple=0 and incorrect output for multiple < 0.

Was AI used for this PR?

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@rok
rok marked this pull request as ready for review December 4, 2026 18:43
@rok
rok requested review from AlenkaF and raulcd as code owners December 4, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++][Python] round_temporal/floor_temporal/ceil_temporal crash the process with multiple=0

1 participant