Pretty-printer for arrow::Array and subclasses.
| 1832 | |
| 1833 | |
| 1834 | class ArrayPrinter: |
| 1835 | """ |
| 1836 | Pretty-printer for arrow::Array and subclasses. |
| 1837 | """ |
| 1838 | |
| 1839 | def __init__(self, val): |
| 1840 | data = deref(val['data_']) |
| 1841 | self.data_printer = ArrayDataPrinter("arrow::ArrayData", data) |
| 1842 | self.name = array_class_from_type(self.data_printer.type_name) |
| 1843 | |
| 1844 | def _format_contents(self): |
| 1845 | return self.data_printer._format_contents() |
| 1846 | |
| 1847 | def to_string(self): |
| 1848 | if self.data_printer.type_class.is_parametric: |
| 1849 | ty = self.data_printer.type |
| 1850 | return f"arrow::{self.name} of type {ty}, {self._format_contents()}" |
| 1851 | else: |
| 1852 | return f"arrow::{self.name} of {self._format_contents()}" |
| 1853 | |
| 1854 | def display_hint(self): |
| 1855 | return self.data_printer.display_hint() |
| 1856 | |
| 1857 | def children(self): |
| 1858 | return self.data_printer.children() |
| 1859 | |
| 1860 | |
| 1861 | class ChunkedArrayPrinter: |
no outgoing calls
no test coverage detected