def _all_compat(self, other: Self, compat_str: str) -> bool:
        """Helper function for equals, broadcast_equals, and identical"""

        def compat(x, y):
            return getattr(x.variable, compat_str)(y.variable)

        return utils.dict_equiv(self.coords, other.coords, compat=compat) and compat(
            self, other
        )
Helper function for equals, broadcast_equals, and identical
xarray/core/dataarray.py