def get_local_path(self) -> Optional[str]:
        """Return path to a file in a local cache.

        Returns None if file is not cached.
        Raises an exception if cache is not setup.
        """
        if self._catalog is None:
            raise RuntimeError(
                "cannot resolve local file path because catalog is not setup"
            )
        return self._catalog.cache.get_path(self)
Return path to a file in a local cache.

        Returns None if file is not cached.
        Raises an exception if cache is not setup.
        
src/datachain/lib/file.py