def get_latest_cached_states(self, task_id: str, cache_key: Optional[str], created_after: datetime.datetime) -> List['prefect.engine.state.State']:
    "\n        Pulls all Cached states for the given task that were created after the provided date.\n\n        Args:\n            - task_id (str): the task id for this task run\n            - cache_key (Optional[str]): the cache key for this Task's cache; if `None`, the\n                task id alone will be used\n            - created_after (datetime.datetime): the earliest date the state should have been\n                created at\n\n        Returns:\n            - List[State]: a list of Cached states created after the given date\n        "
    args = {'where': {'state': {'_eq': 'Cached'}, 'state_timestamp': {'_gte': created_after.isoformat()}}, 'order_by': {'state_timestamp': EnumValue('desc')}, 'limit': 100}
    if (cache_key is not None):
        args['where'].update({'cache_key': {'_eq': cache_key}})
    else:
        args['where'].update({'task_id': {'_eq': task_id}})
    query = {'query': {with_args('task_run', args): 'serialized_state'}}
    result = self.graphql(query)
    deserializer = prefect.engine.state.State.deserialize
    valid_states = [deserializer(res.serialized_state) for res in result.data.task_run]
    return valid_states
Pulls all Cached states for the given task that were created after the provided date.

Args:
    - task_id (str): the task id for this task run
    - cache_key (Optional[str]): the cache key for this Task's cache; if `None`, the
        task id alone will be used
    - created_after (datetime.datetime): the earliest date the state should have been
        created at

Returns:
    - List[State]: a list of Cached states created after the given date
def get_latest_cached_states(self, task_id: str, cache_key: Optional[str], created_after: datetime.datetime) -> List['prefect.engine.state.State']:
    "\n        Pulls all Cached states for the given task that were created after the provided date.\n\n        Args:\n            - task_id (str): the task id for this task run\n            - cache_key (Optional[str]): the cache key for this Task's cache; if `None`, the\n                task id alone will be used\n            - created_after (datetime.datetime): the earliest date the state should have been\n                created at\n\n        Returns:\n            - List[State]: a list of Cached states created after the given date\n        "
    args = {'where': {'state': {'_eq': 'Cached'}, 'state_timestamp': {'_gte': created_after.isoformat()}}, 'order_by': {'state_timestamp': EnumValue('desc')}, 'limit': 100}
    if (cache_key is not None):
        args['where'].update({'cache_key': {'_eq': cache_key}})
    else:
        args['where'].update({'task_id': {'_eq': task_id}})
    query = {'query': {with_args('task_run', args): 'serialized_state'}}
    result = self.graphql(query)
    deserializer = prefect.engine.state.State.deserialize
    valid_states = [deserializer(res.serialized_state) for res in result.data.task_run]
    return valid_states