Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Dec 23, 2025

Rationale for this change

A 7-year-old TODO suggested adding a type validation assertion in InferDecimalPrecisionAndScale(). This helps catch type errors during development in debug builds.

What changes are included in this PR?

Added ARROW_DCHECK(PyDecimal_Check(python_decimal)) assertion in InferDecimalPrecisionAndScale() to validate that the input is a decimal.Decimal instance.

This resolves the TODO added in commit 9515fe9

Are these changes tested?

Yes. Existing tests in python_test.cc already execute this code path through DecimalMetadata::Update(). The assertion is debug-only and doesn't change runtime behavior.

Are there any user-facing changes?

No, dev-only.

@github-actions
Copy link

⚠️ GitHub issue #48627 has been automatically assigned in GitHub to PR creator.

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.

1 participant