Pretty-printer for arrow::Array and subclasses.
| 1815 | |
| 1816 | |
| 1817 | class ArrayPrinter: |
| 1818 | """ |
| 1819 | Pretty-printer for arrow::Array and subclasses. |
| 1820 | """ |
| 1821 | |
| 1822 | def __init__(self, val): |
| 1823 | data = deref(val['data_']) |
| 1824 | self.data_printer = ArrayDataPrinter("arrow::ArrayData", data) |
| 1825 | self.name = array_class_from_type(self.data_printer.type_name) |
| 1826 | |
| 1827 | def _format_contents(self): |
| 1828 | return self.data_printer._format_contents() |
| 1829 | |
| 1830 | def to_string(self): |
| 1831 | if self.data_printer.type_class.is_parametric: |
| 1832 | ty = self.data_printer.type |
| 1833 | return f"arrow::{self.name} of type {ty}, {self._format_contents()}" |
| 1834 | else: |
| 1835 | return f"arrow::{self.name} of {self._format_contents()}" |
| 1836 | |
| 1837 | def display_hint(self): |
| 1838 | return self.data_printer.display_hint() |
| 1839 | |
| 1840 | def children(self): |
| 1841 | return self.data_printer.children() |
| 1842 | |
| 1843 | |
| 1844 | class ChunkedArrayPrinter: |
no outgoing calls
no test coverage detected