From a5913b7c4a96aa483a18eb92df67ba7dba8eb1bb Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Tue, 23 Dec 2025 14:45:04 +0900 Subject: [PATCH] [Python] Add PyDecimal_Check(pythopn_decimal) as a ARROW_DCHECK --- python/pyarrow/src/arrow/python/decimal.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyarrow/src/arrow/python/decimal.cc b/python/pyarrow/src/arrow/python/decimal.cc index 1ba8d32192a..48fb45a2377 100644 --- a/python/pyarrow/src/arrow/python/decimal.cc +++ b/python/pyarrow/src/arrow/python/decimal.cc @@ -51,9 +51,9 @@ static Status InferDecimalPrecisionAndScale(PyObject* python_decimal, int32_t* p ARROW_DCHECK_NE(python_decimal, NULLPTR); ARROW_DCHECK_NE(precision, NULLPTR); ARROW_DCHECK_NE(scale, NULLPTR); + ARROW_DCHECK(PyDecimal_Check(python_decimal)) + << "python_decimal is not an instance of decimal.Decimal"; - // TODO(phillipc): Make sure we perform PyDecimal_Check(python_decimal) as a - // ARROW_DCHECK OwnedRef as_tuple(PyObject_CallMethod(python_decimal, const_cast("as_tuple"), const_cast(""))); RETURN_IF_PYERROR();