{"record":{"id":"6bbf8f06a53403d3","repo":"pathwaycom/pathway","slug":"param-name-must-be-a-number-of-seconds-int-or","errorCode":null,"errorMessage":"'{param_name}' must be a number of seconds (int or float) or a datetime.timedelta, got {type(value).__name__}","messagePattern":"'(.+?)' must be a number of seconds \\(int or float\\) or a datetime\\.timedelta, got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/_utils.py","lineNumber":121,"sourceCode":"    converted with ``total_seconds()``.\n\n    Args:\n        value: The value of the parameter to be coerced.\n        param_name: The name of the parameter, used in error messages.\n        allow_zero: If ``True`` (the default), a zero duration is accepted: for\n            polling-type intervals it is a legitimate way to ask for updates as\n            often as possible, at the price of a busy-wait loop. Set to ``False``\n            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","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/_utils.py#L103-L139","documentation":"Error \"'{param_name}' must be a number of seconds (int or float) or a datetime.timedelta, got {type(value).__name__}\" thrown in pathwaycom/pathway.","triggerScenarios":"Thrown at python/pathway/io/_utils.py:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the duration parameter as a number of seconds (int/float) or a datetime.timedelta instead of the value that was given."],"exampleFix":"pw.io.fs.read(path, refresh_interval=60)  # or refresh_interval=datetime.timedelta(minutes=1)","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"}