def get_task_run_info(self, flow_run_id: str, task_id: str, map_index: Optional[int]=None) -> TaskRunInfoResult:
    '\n        Retrieves version and current state information for the given task run.\n\n        Args:\n            - flow_run_id (str): the id of the flow run that this task run lives in\n            - task_id (str): the task id for this task run\n            - map_index (int, optional): the mapping index for this task run; if\n                `None`, it is assumed this task is _not_ mapped\n\n        Returns:\n            - NamedTuple: a tuple containing `id, task_id, version, state`\n\n        Raises:\n            - ClientError: if the GraphQL mutation is bad for any reason\n        '
    mutation = {'mutation': {with_args('get_or_create_task_run', {'input': {'flow_run_id': flow_run_id, 'task_id': task_id, 'map_index': ((- 1) if (map_index is None) else map_index)}}): {'id': True}}}
    result = self.graphql(mutation)
    if (result is None):
        raise ClientError('Failed to create task run.')
    task_run_id = result.data.get_or_create_task_run.id
    query = {'query': {with_args('task_run_by_pk', {'id': task_run_id}): {'version': True, 'serialized_state': True, 'task': {'slug': True}}}}
    task_run = self.graphql(query).data.task_run_by_pk
    if (task_run is None):
        raise ClientError('Task run ID not found: "{}"'.format(task_run_id))
    state = prefect.engine.state.State.deserialize(task_run.serialized_state)
    return TaskRunInfoResult(id=task_run_id, task_id=task_id, task_slug=task_run.task.slug, version=task_run.version, state=state)
Retrieves version and current state information for the given task run.

Args:
    - flow_run_id (str): the id of the flow run that this task run lives in
    - task_id (str): the task id for this task run
    - map_index (int, optional): the mapping index for this task run; if
        `None`, it is assumed this task is _not_ mapped

Returns:
    - NamedTuple: a tuple containing `id, task_id, version, state`

Raises:
    - ClientError: if the GraphQL mutation is bad for any reason
def get_task_run_info(self, flow_run_id: str, task_id: str, map_index: Optional[int]=None) -> TaskRunInfoResult:
    '\n        Retrieves version and current state information for the given task run.\n\n        Args:\n            - flow_run_id (str): the id of the flow run that this task run lives in\n            - task_id (str): the task id for this task run\n            - map_index (int, optional): the mapping index for this task run; if\n                `None`, it is assumed this task is _not_ mapped\n\n        Returns:\n            - NamedTuple: a tuple containing `id, task_id, version, state`\n\n        Raises:\n            - ClientError: if the GraphQL mutation is bad for any reason\n        '
    mutation = {'mutation': {with_args('get_or_create_task_run', {'input': {'flow_run_id': flow_run_id, 'task_id': task_id, 'map_index': ((- 1) if (map_index is None) else map_index)}}): {'id': True}}}
    result = self.graphql(mutation)
    if (result is None):
        raise ClientError('Failed to create task run.')
    task_run_id = result.data.get_or_create_task_run.id
    query = {'query': {with_args('task_run_by_pk', {'id': task_run_id}): {'version': True, 'serialized_state': True, 'task': {'slug': True}}}}
    task_run = self.graphql(query).data.task_run_by_pk
    if (task_run is None):
        raise ClientError('Task run ID not found: "{}"'.format(task_run_id))
    state = prefect.engine.state.State.deserialize(task_run.serialized_state)
    return TaskRunInfoResult(id=task_run_id, task_id=task_id, task_slug=task_run.task.slug, version=task_run.version, state=state)