MCPcopy Create free account
hub / github.com/dask/dask / _tree_repr_lines

Method _tree_repr_lines

dask/dataframe/dask_expr/_expr.py:114–141  ·  view source on GitHub ↗
(self, indent=0, recursive=True)

Source from the content-addressed store, hash-verified

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 = []

Callers 2

_tree_repr_linesMethod · 0.45

Calls 6

funcnameFunction · 0.90
is_arraylikeFunction · 0.90
is_dataframe_likeFunction · 0.85
is_index_likeFunction · 0.85
is_series_likeFunction · 0.85

Tested by 1