{"record":{"id":"588d1d857defb63d","repo":"pathwaycom/pathway","slug":"got-unexpected-keyword-arguments-unexpected-arg","errorCode":null,"errorMessage":"Got unexpected keyword arguments: {unexpected_arg_names}","messagePattern":"Got unexpected keyword arguments: (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/_utils.py","lineNumber":169,"sourceCode":"def check_deprecated_kwargs(\n    kwargs: dict[str, Any], deprecated_kwarg_names: list[str], stacklevel: int = 2\n):\n    for kwarg_name in deprecated_kwarg_names:\n        if kwarg_name in kwargs:\n            warnings.warn(\n                f\"'{kwarg_name}' is deprecated and will be ignored\",\n                DeprecationWarning,\n                stacklevel=stacklevel + 1,\n            )\n            kwargs.pop(kwarg_name)\n    deprecated_kwargs_with_custom_report = [\"persistent_id\"]\n    unexpected_args_list = []\n    for kwarg in kwargs.keys():\n        if kwarg not in deprecated_kwargs_with_custom_report:\n            unexpected_args_list.append(kwarg)\n    if unexpected_args_list:\n        unexpected_arg_names = \", \".join(repr(arg) for arg in unexpected_args_list)\n        raise TypeError(f\"Got unexpected keyword arguments: {unexpected_arg_names}\")\n\n\ndef internal_connector_mode(mode: str | api.ConnectorMode) -> api.ConnectorMode:\n    if isinstance(mode, api.ConnectorMode):\n        return mode\n    internal_mode = _INPUT_MODES_MAPPING.get(mode)\n    if not internal_mode:\n        raise ValueError(\n            \"Unknown mode: {}. Only {} are supported\".format(\n                mode, \", \".join(_INPUT_MODES_MAPPING.keys())\n            )\n        )\n\n    return internal_mode\n\n\ndef internal_read_method(format: str) -> ReadMethod:\n    if format in (","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/_utils.py#L151-L187","documentation":"Error \"Got unexpected keyword arguments: {unexpected_arg_names}\" thrown in pathwaycom/pathway.","triggerScenarios":"Thrown at python/pathway/io/_utils.py:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the unexpected keyword arguments or fix their spelling; check the connector's documentation for the accepted parameter names."],"exampleFix":"pw.io.fs.read(path, format='json', schema=MySchema)  # removed the unknown kwarg","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}