pathwaycom/pathway · error · TypeError
Got unexpected keyword arguments: {unexpected_arg_names}
Error message
Got unexpected keyword arguments: {unexpected_arg_names} What it means
Error "Got unexpected keyword arguments: {unexpected_arg_names}" thrown in pathwaycom/pathway.
Source
Thrown at python/pathway/io/_utils.py:169
def check_deprecated_kwargs(
kwargs: dict[str, Any], deprecated_kwarg_names: list[str], stacklevel: int = 2
):
for kwarg_name in deprecated_kwarg_names:
if kwarg_name in kwargs:
warnings.warn(
f"'{kwarg_name}' is deprecated and will be ignored",
DeprecationWarning,
stacklevel=stacklevel + 1,
)
kwargs.pop(kwarg_name)
deprecated_kwargs_with_custom_report = ["persistent_id"]
unexpected_args_list = []
for kwarg in kwargs.keys():
if kwarg not in deprecated_kwargs_with_custom_report:
unexpected_args_list.append(kwarg)
if unexpected_args_list:
unexpected_arg_names = ", ".join(repr(arg) for arg in unexpected_args_list)
raise TypeError(f"Got unexpected keyword arguments: {unexpected_arg_names}")
def internal_connector_mode(mode: str | api.ConnectorMode) -> api.ConnectorMode:
if isinstance(mode, api.ConnectorMode):
return mode
internal_mode = _INPUT_MODES_MAPPING.get(mode)
if not internal_mode:
raise ValueError(
"Unknown mode: {}. Only {} are supported".format(
mode, ", ".join(_INPUT_MODES_MAPPING.keys())
)
)
return internal_mode
def internal_read_method(format: str) -> ReadMethod:
if format in (View on GitHub (pinned to fa2f74a464)
Solutions
- Remove the unexpected keyword arguments or fix their spelling; check the connector's documentation for the accepted parameter names.
Example fix
pw.io.fs.read(path, format='json', schema=MySchema) # removed the unknown kwarg
When it happens
Trigger: Thrown at python/pathway/io/_utils.py:169 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/588d1d857defb63d.
Report an issue: GitHub.