docstr: Update an existing asset version
docstr_tok: ["Update","an","existing","asset","version"]
code: def update(
      self, asset_path: str, name: str, version: str, dry_run=False
  ):
      """
      Update an existing asset version
      """
      spec = AssetSpec(name=name, version=version)
      versions_object_name = self.get_versions_object_name(spec.name)
      if not self.driver.exists(versions_object_name):
          raise errors.AssetDoesNotExistError(spec.name)
      logger.info(
          "Updating asset",
          name=spec.name,
          version=spec.version,
          asset_path=asset_path,
      )
      versions_list = self.get_versions_info(spec.name)
  
      self.push(asset_path, spec.name, spec.version, dry_run=dry_run)
  
      with tempfile.TemporaryDirectory() as tmp_dir:
          versions_fn = os.path.join(tmp_dir, "versions.json")
          versions = spec.sort_versions([spec.version] + versions_list)
          with open(versions_fn, "w") as f:
              json.dump({"versions": versions}, f)
          logger.debug(
              "Pushing updated versions file",
              name=spec.name,
              versions=versions,
          )
          if not dry_run:
              self.driver.upload_object(
                  versions_fn, versions_object_name
              )
  
imports: import datetime
  import glob
  import json
  import os
  import tempfile
  import time
  from typing import Any, Optional
  import humanize
  from dateutil import parser, tz
  from structlog import get_logger
  from modelkit.assets import errors
  from modelkit.assets.drivers.abc import StorageDriver
  from modelkit.assets.drivers.local import LocalStorageDriver, LocalStorageDriverSettings
  from modelkit.assets.settings import AssetSpec
  from modelkit.utils.logging import ContextualizedLogging
label_desc: Use image node_id 8 for calling the StorageProvider obj's underlying member method code with example usage: obj.update(asset_path, name, version, dry_run) without return types