docstr: Update a key value entry
  
  :param resource: the resource (dashboard, chart etc)
  :param key: the key to update
  :param value: the value to persist in the key-value store
  :param codec: codec used to encode the value
  :param expires_on: entry expiration time
  :return: the key associated with the updated value
docstr_tok: ["Update","a","key","value","entry",":","param","resource",":","the","resource","(","dashboard",",","chart","etc",")",":","param","key",":","the","key","to","update",":","param","value",":","the","value","to","persist","in","the","key-value","store",":","param","codec",":","codec","used","to","encode","the","value",":","param","expires_on",":","entry","expiration","time",":","return",":","the","key","associated","with","the","updated","value"]
code: def __init__(  # pylint: disable=too-many-arguments
      self,
      resource: KeyValueResource,
      key: Union[int, UUID],
      value: Any,
      codec: KeyValueCodec,
      expires_on: Optional[datetime] = None,
  ):
      """
      Update a key value entry
  
      :param resource: the resource (dashboard, chart etc)
      :param key: the key to update
      :param value: the value to persist in the key-value store
      :param codec: codec used to encode the value
      :param expires_on: entry expiration time
      :return: the key associated with the updated value
      """
      self.resource = resource
      self.key = key
      self.value = value
      self.codec = codec
      self.expires_on = expires_on
  
file_path: superset/superset/commands/key_value/update.py
imports: import logging
  from datetime import datetime
  from typing import Any, Optional, Union
  from uuid import UUID
  from sqlalchemy.exc import SQLAlchemyError
  from superset import db
  from superset.commands.base import BaseCommand
  from superset.key_value.exceptions import KeyValueUpdateFailedError
  from superset.key_value.models import KeyValueEntry
  from superset.key_value.types import Key, KeyValueCodec, KeyValueResource
  from superset.key_value.utils import get_filter
  from superset.utils.core import get_user_id
label_desc: Use image node_id 1 to create a new UpdateKeyValueCommand object from inherited base classes: BaseCommand with example: obj = UpdateKeyValueCommand(resource, key, value, codec, expires_on)