def to_projection(self): """ Promote this column expression to a table projection """ roots = self._root_tables() if len(roots) > 1: raise RelationError('Cannot convert array expression involving ' 'multiple base table references to a ' 'projection') table = TableExpr(roots[0]) return table.projection([self])
def assert_valid(self, expr): if not self.validate(expr): msg = self._error_message(expr) raise RelationError(msg)