MCPcopy Create free account
hub / github.com/apache/arrow / test_decimals

Function test_decimals

python/pyarrow/tests/test_gdb.py:288–314  ·  view source on GitHub ↗
(gdb_arrow)

Source from the content-addressed store, hash-verified

286
287
288def test_decimals(gdb_arrow):
289 v128 = "98765432109876543210987654321098765432"
290 check_stack_repr(gdb_arrow, "decimal128_zero", "arrow::Decimal128(0)")
291 check_stack_repr(gdb_arrow, "decimal128_pos",
292 f"arrow::Decimal128({v128})")
293 check_stack_repr(gdb_arrow, "decimal128_neg",
294 f"arrow::Decimal128(-{v128})")
295 check_stack_repr(gdb_arrow, "basic_decimal128_zero",
296 "arrow::BasicDecimal128(0)")
297 check_stack_repr(gdb_arrow, "basic_decimal128_pos",
298 f"arrow::BasicDecimal128({v128})")
299 check_stack_repr(gdb_arrow, "basic_decimal128_neg",
300 f"arrow::BasicDecimal128(-{v128})")
301
302 v256 = ("9876543210987654321098765432109876543210"
303 "987654321098765432109876543210987654")
304 check_stack_repr(gdb_arrow, "decimal256_zero", "arrow::Decimal256(0)")
305 check_stack_repr(gdb_arrow, "decimal256_pos",
306 f"arrow::Decimal256({v256})")
307 check_stack_repr(gdb_arrow, "decimal256_neg",
308 f"arrow::Decimal256(-{v256})")
309 check_stack_repr(gdb_arrow, "basic_decimal256_zero",
310 "arrow::BasicDecimal256(0)")
311 check_stack_repr(gdb_arrow, "basic_decimal256_pos",
312 f"arrow::BasicDecimal256({v256})")
313 check_stack_repr(gdb_arrow, "basic_decimal256_neg",
314 f"arrow::BasicDecimal256(-{v256})")
315
316
317def test_metadata(gdb_arrow):

Callers

nothing calls this directly

Calls 1

check_stack_reprFunction · 0.85

Tested by

no test coverage detected