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

Class BufferPrinter

cpp/gdb_arrow.py:2319–2339  ·  view source on GitHub ↗

Pretty-printer for arrow::Buffer and subclasses.

Source from the content-addressed store, hash-verified

2317
2318
2319class BufferPrinter:
2320 """
2321 Pretty-printer for arrow::Buffer and subclasses.
2322 """
2323
2324 def __init__(self, name, val):
2325 self.name = name
2326 self.val = val
2327
2328 def to_string(self):
2329 if bool(self.val['is_mutable_']):
2330 mutable = 'mutable'
2331 else:
2332 mutable = 'read-only'
2333 size = int(self.val['size_'])
2334 if size == 0:
2335 return f"arrow::{self.name} of size 0, {mutable}"
2336 if not self.val['is_cpu_']:
2337 return f"arrow::{self.name} of size {size}, {mutable}, not on CPU"
2338 data = bytes_literal(self.val['data_'], size)
2339 return f"arrow::{self.name} of size {size}, {mutable}, {data}"
2340
2341
2342class DayMillisecondsPrinter:

Callers 1

arrow_pretty_printFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected