def set_workspace(self, workspace: str):
        """Sets the active workspace.

        Args:
            workspace: The new workspace
        """
        if not workspace:
            raise Exception("Must provide a workspace")

        if not re.match(WORKSPACE_NAME_REGEX_PATTERN, workspace):
            raise InputValueError(
                f"Provided workspace name {workspace} does not match the pattern"
                f" {WORKSPACE_NAME_REGEX_PATTERN}. Please, use a valid name for your"
                " workspace. This limitation is caused by naming conventions for indexes"
                " in Elasticsearch. If applicable, you can try to lowercase the name of your workspace."
                " https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html"
            )

        if workspace != self.get_workspace():
            if workspace in [ws.name for ws in self.list_workspaces()]:
                self.http_client.update_headers({WORKSPACE_HEADER_NAME: workspace})
            else:
                raise ValueError(f"Wrong provided workspace {workspace!r}")
Sets the active workspace.

        Args:
            workspace: The new workspace
        
argilla-v1/src/argilla_v1/client/client.py