def data(self):
        """
        The Variable's data as an array. The underlying array type
        (e.g. dask, sparse, pint) is preserved.

        See Also
        --------
        Variable.to_numpy
        Variable.as_numpy
        Variable.values
        """
        if isinstance(self._data, PandasExtensionArray):
            duck_array = self._data.array
        elif isinstance(self._data, indexing.ExplicitlyIndexed):
            duck_array = self._data.get_duck_array()
        elif is_duck_array(self._data):
            duck_array = self._data
        else:
            duck_array = self.values
        if isinstance(duck_array, PandasExtensionArray):
            # even though PandasExtensionArray is a duck array,
            # we should not return the PandasExtensionArray wrapper,
            # and instead return the underlying data.
            return duck_array.array
        return duck_array

        The Variable's data as an array. The underlying array type
        (e.g. dask, sparse, pint) is preserved.

        See Also
        --------
        Variable.to_numpy
        Variable.as_numpy
        Variable.values
        
xarray/core/variable.py