{"record":{"id":"d3584ee4f2623e75","repo":"juicedata/juicefs","slug":"warmup-got-an-unexpected-keyword-argument-k","errorCode":null,"errorMessage":"warmup() got an unexpected keyword argument '{k}'","messagePattern":"warmup\\(\\) got an unexpected keyword argument '(.+?)'","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"sdk/python/juicefs/juicefs/juicefs.py","lineNumber":450,"sourceCode":"            elif entry.get(\"Children\") is not None:\n                for v in entry[\"Children\"]:\n                    parseSummary(v, removefields)\n\n        parseSummary(res, [\"Inode\"])\n        self.lib.free(buf)\n        return res\n\n    def warmup(self, paths, threads=10, evict=False, check=False, background=False, **kwargs):\n        # numthreads=10, background=False, isEvict=False, isCheck=False,\n        for k in kwargs:\n            if k == 'numthreads':\n                threads = kwargs[k]\n            elif k == 'isEvict':\n                evict = kwargs[k]\n            elif k == 'isCheck':\n                check = kwargs[k]\n            else:\n                raise TypeError(f\"warmup() got an unexpected keyword argument '{k}'\")\n\n        \"\"\"Warm up a file or a directory.\"\"\"\n        if type(paths) is not list:\n            paths = [paths]\n\n        buf = c_void_p()\n\n        n = self.lib.jfs_warmup(c_int64(_tid()), c_int64(self.h), json.dumps(paths).encode(), c_int32(threads), c_bool(background), c_bool(evict), c_bool(check), byref(buf))\n        res = json.loads(str(string_at(buf, n), encoding='utf-8'))\n        self.lib.free(buf)\n        return res\n\n    def status(self, trash=False, session=0):\n        \"\"\"Get the status of the volume and client sessions.\"\"\"\n        buf = c_void_p()\n        n = self.lib.jfs_status(c_int64(_tid()), c_int64(self.h), c_bool(trash), c_bool(session), byref(buf))\n        res = json.loads(str(string_at(buf, n), encoding='utf-8'))\n        self.lib.free(buf)","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/python/juicefs/juicefs/juicefs.py#L432-L468","documentation":"warmup() accepts only a fixed set of keyword arguments (paths plus kwargs keys such as 'threads', 'isEvict', 'isCheck'). Any other key in kwargs raises TypeError(\"warmup() got an unexpected keyword argument '{k}'\").","triggerScenarios":"Calling warmup(path, background=True), warmup(p, evict=1) (wrong name; must be isEvict), or any misspelled/unsupported kwarg like purge=, through=.","commonSituations":"Typos in kwarg names (evict vs isEvict, thread vs threads); copying kwargs from other fsspec/CLI warm-up APIs; version drift where an option exists in the CLI but not in this Python binding.","solutions":["Use only the supported kwargs: threads, isEvict, isCheck","Rename misspelled kwargs to the exact supported names (e.g. evict -> isEvict)","Check the warmup signature in sdk/python/juicefs/juicefs/juicefs.py for your installed version"],"exampleFix":"// before\nfs.warmup('/data', evict=True, purge=False)\n// after\nfs.warmup('/data', isEvict=True, isCheck=False, threads=4)","handlingStrategy":"validation","validationCode":"ALLOWED = {'threads', 'isEvict', 'isCheck'}\nbad = set(kwargs) - ALLOWED\nif bad:\n    raise TypeError(f'unsupported warmup kwargs: {bad}')","typeGuard":null,"tryCatchPattern":"try:\n    fs.warmup(path, **opts)\nexcept TypeError as e:\n    logger.warning('warmup kwargs rejected: %s', e)","preventionTips":["Match kwarg names exactly (isEvict/isCheck/threads)","Inspect the warmup signature for your installed version"],"tags":["python","typeerror","kwargs","api-misuse"],"backgroundTag":"missing-required-argument","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}