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

Function test_decimals

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

Source from the content-addressed store, hash-verified

286
287
288def test_decimals(gdb_arrow):
289 v32 = "987654321"
290 check_stack_repr(gdb_arrow, "decimal32_zero", "arrow::Decimal32(0)")
291 check_stack_repr(gdb_arrow, "decimal32_pos",
292 f"arrow::Decimal32({v32})")
293 check_stack_repr(gdb_arrow, "decimal32_neg",
294 f"arrow::Decimal32(-{v32})")
295 check_stack_repr(gdb_arrow, "basic_decimal32_zero",
296 "arrow::BasicDecimal32(0)")
297 check_stack_repr(gdb_arrow, "basic_decimal32_pos",
298 f"arrow::BasicDecimal32({v32})")
299 check_stack_repr(gdb_arrow, "basic_decimal32_neg",
300 f"arrow::BasicDecimal32(-{v32})")
301
302 v64 = "987654321098765432"
303 check_stack_repr(gdb_arrow, "decimal64_zero", "arrow::Decimal64(0)")
304 check_stack_repr(gdb_arrow, "decimal64_pos",
305 f"arrow::Decimal64({v64})")
306 check_stack_repr(gdb_arrow, "decimal64_neg",
307 f"arrow::Decimal64(-{v64})")
308 check_stack_repr(gdb_arrow, "basic_decimal64_zero",
309 "arrow::BasicDecimal64(0)")
310 check_stack_repr(gdb_arrow, "basic_decimal64_pos",
311 f"arrow::BasicDecimal64({v64})")
312 check_stack_repr(gdb_arrow, "basic_decimal64_neg",
313 f"arrow::BasicDecimal64(-{v64})")
314
315 v128 = "98765432109876543210987654321098765432"
316 check_stack_repr(gdb_arrow, "decimal128_zero", "arrow::Decimal128(0)")
317 check_stack_repr(gdb_arrow, "decimal128_pos",
318 f"arrow::Decimal128({v128})")
319 check_stack_repr(gdb_arrow, "decimal128_neg",
320 f"arrow::Decimal128(-{v128})")
321 check_stack_repr(gdb_arrow, "basic_decimal128_zero",
322 "arrow::BasicDecimal128(0)")
323 check_stack_repr(gdb_arrow, "basic_decimal128_pos",
324 f"arrow::BasicDecimal128({v128})")
325 check_stack_repr(gdb_arrow, "basic_decimal128_neg",
326 f"arrow::BasicDecimal128(-{v128})")
327
328 v256 = ("9876543210987654321098765432109876543210"
329 "987654321098765432109876543210987654")
330 check_stack_repr(gdb_arrow, "decimal256_zero", "arrow::Decimal256(0)")
331 check_stack_repr(gdb_arrow, "decimal256_pos",
332 f"arrow::Decimal256({v256})")
333 check_stack_repr(gdb_arrow, "decimal256_neg",
334 f"arrow::Decimal256(-{v256})")
335 check_stack_repr(gdb_arrow, "basic_decimal256_zero",
336 "arrow::BasicDecimal256(0)")
337 check_stack_repr(gdb_arrow, "basic_decimal256_pos",
338 f"arrow::BasicDecimal256({v256})")
339 check_stack_repr(gdb_arrow, "basic_decimal256_neg",
340 f"arrow::BasicDecimal256(-{v256})")
341
342
343def test_metadata(gdb_arrow):

Callers

nothing calls this directly

Calls 1

check_stack_reprFunction · 0.85

Tested by

no test coverage detected