

def _memoize_tables(self):
    table_memo_ops = (ops.Aggregation, ops.Selection, ops.SelfReference)

    def walk(expr):
        op = expr.op()

        def visit(arg):
            if isinstance(arg, list):
                [visit(x) for x in arg]
            elif isinstance(arg, ir.Expr):
                walk(arg)
        if isinstance(op, ops.PhysicalTable):
            self.memo.observe(op, self._format_table)
        elif isinstance(op, ir.Node):
            visit(op.args)
            if isinstance(op, table_memo_ops):
                self.memo.observe(op, self._format_node)
        elif (isinstance(op, ops.TableNode) and op.has_schema()):
            self.memo.observe(op, self._format_table)
    walk(self.expr)

dataset/ETHPy150Open cloudera/ibis/ibis/expr/format.py ExprFormatter._memoize_tables/original