| 112 | return NBytes(self) |
| 113 | |
| 114 | def _tree_repr_lines(self, indent=0, recursive=True): |
| 115 | header = funcname(type(self)) + ":" |
| 116 | lines = [] |
| 117 | for i, op in enumerate(self.operands): |
| 118 | if isinstance(op, Expr): |
| 119 | if recursive: |
| 120 | lines.extend(op._tree_repr_lines(2)) |
| 121 | else: |
| 122 | if isinstance(op, _BackendData): |
| 123 | op = op._data |
| 124 | |
| 125 | # TODO: this stuff is pandas-specific |
| 126 | if isinstance(op, pd.core.base.PandasObject): |
| 127 | op = "<pandas>" |
| 128 | elif is_dataframe_like(op): |
| 129 | op = "<dataframe>" |
| 130 | elif is_index_like(op): |
| 131 | op = "<index>" |
| 132 | elif is_series_like(op): |
| 133 | op = "<series>" |
| 134 | elif is_arraylike(op): |
| 135 | op = "<array>" |
| 136 | header = self._tree_repr_argument_construction(i, op, header) |
| 137 | |
| 138 | lines = [header] + lines |
| 139 | lines = [" " * indent + line for line in lines] |
| 140 | |
| 141 | return lines |
| 142 | |
| 143 | def _operands_for_repr(self): |
| 144 | to_include = [] |