code: def _clean_args(sys_argv, args):
      
      base = [x for x in sys_argv if
              x.startswith("-") or not args.datadir == os.path.abspath(os.path.expanduser(x))]
      # Remove installer only options we don't pass on
      base = [x for x in base if x not in set(["--minimize-disk"])]
      if "--nodata" in base:
          base.remove("--nodata")
      else:
          base.append("--data")
      return base
docs: Remove data directory from arguments to pass to upgrade function.