{"record":{"id":"c181a8202eeb7f76","repo":"pathwaycom/pathway","slug":"param-name-must-be-constraint-got-value-r","errorCode":null,"errorMessage":"'{param_name}' must be {constraint}, got {value!r}","messagePattern":"'(.+?)' must be (.+?), got (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/_utils.py","lineNumber":129,"sourceCode":"            for parameters where zero can never be meaningful (e.g. timeouts).\n\n    Returns:\n        The duration expressed as a float number of seconds.\n    \"\"\"\n    if isinstance(value, datetime.timedelta):\n        seconds = value.total_seconds()\n    elif isinstance(value, (int, float)) and not isinstance(value, bool):\n        seconds = float(value)\n    else:\n        raise TypeError(\n            f\"'{param_name}' must be a number of seconds (int or float) or a \"\n            f\"datetime.timedelta, got {type(value).__name__}\"\n        )\n    if not math.isfinite(seconds):\n        raise ValueError(f\"'{param_name}' must be finite, got {value!r}\")\n    if seconds < 0 or (seconds == 0 and not allow_zero):\n        constraint = \"non-negative\" if allow_zero else \"positive\"\n        raise ValueError(f\"'{param_name}' must be {constraint}, got {value!r}\")\n    return seconds\n\n\nclass RawDataSchema(pw.Schema):\n    data: bytes\n\n\nclass PlaintextDataSchema(pw.Schema):\n    data: str\n\n\nclass MetadataSchema(Schema):\n    _metadata: dict\n\n\ndef get_data_format_type(format: str, supported_formats: set[str]):\n    if format not in _DATA_FORMAT_MAPPING or format not in supported_formats:\n        raise ValueError(f\"data format `{format}` not supported\")","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/_utils.py#L111-L147","documentation":"Error \"'{param_name}' must be {constraint}, got {value!r}\" thrown in pathwaycom/pathway.","triggerScenarios":"Thrown at python/pathway/io/_utils.py:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a value that satisfies the stated constraint (e.g. positive, non-negative) for this parameter."],"exampleFix":"pw.io.kafka.read(rdkafka_settings, topic='t', autocommit_duration_ms=1000)","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-15T17:31:12.345Z"}