def iter_lineage(self: Tree) -> tuple[Tree, ...]:
        """Iterate up the tree, starting from the current node."""
        from warnings import warn

        warn(
            "`iter_lineage` has been deprecated, and in the future will raise an error."
            "Please use `parents` from now on.",
            DeprecationWarning,
            stacklevel=2,
        )
        return (self, *self.parents)
Iterate up the tree, starting from the current node.
xarray/core/treenode.py