{"record":{"id":"75d430d22dd60543","repo":"pathwaycom/pathway","slug":"demo-generate-custom-stream-error-nb-rows-should","errorCode":null,"errorMessage":"demo.generate_custom_stream error: nb_rows should be None or strictly positive.","messagePattern":"demo\\.generate_custom_stream error: nb_rows should be None or strictly positive\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/demo/__init__.py","lineNumber":84,"sourceCode":"    ...     'name': lambda x: f'Person {x}',\n    ...     'age': lambda x: 20 + x,\n    ... }\n    >>> class InputSchema(pw.Schema):\n    ...      number: int\n    ...      name: str\n    ...      age: int\n    >>> pw.demo.generate_custom_stream(value_functions, schema=InputSchema, nb_rows=10)\n    <pathway.Table schema={'number': <class 'int'>, 'name': <class 'str'>, 'age': <class 'int'>}>\n\n    In the above example, a data stream is generated with 10 rows, where each row has columns \\\n        'number', 'name', and 'age'.\n    The 'number' column contains values incremented by 1 from 1 to 10, the 'name' column contains 'Person'\n    followed by the respective row index, and the 'age' column contains values starting from 20 incremented by\n    the row index.\n    \"\"\"\n\n    if nb_rows is not None and nb_rows < 0:\n        raise ValueError(\n            \"demo.generate_custom_stream error: nb_rows should be None or strictly positive.\"\n        )\n\n    class FileStreamSubject(pw.io.python.ConnectorSubject):\n        def run(self):\n            def _get_row(i):\n                row = {}\n                for name, fun in value_generators.items():\n                    row[name] = fun(i)\n                return row\n\n            if nb_rows is None:\n                row_index = 0\n                while True:\n                    self.next_json(_get_row(row_index))\n                    row_index = row_index + 1\n                    time.sleep(1.0 / input_rate)\n            else:","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/demo/__init__.py#L66-L102","documentation":"The airbyte connector's refresh_interval_ms parameter was replaced by refresh_interval, which takes seconds (int/float) or a datetime.timedelta. Passing the old parameter now raises a TypeError immediately, with a computed suggestion converting the old milliseconds value to seconds.","triggerScenarios":"Calling pw.io.airbyte.read(..., refresh_interval_ms=30000) on a Pathway version where the parameter was removed.","commonSituations":"Code written against an older Pathway release (or copied from old docs/tutorials) after upgrading Pathway; the same call previously worked and now fails at argument validation.","solutions":["Replace refresh_interval_ms=X with refresh_interval=X/1000 (seconds) or refresh_interval=timedelta(milliseconds=X).","Apply the exact suggestion printed in the error message, e.g. refresh_interval=30.","Search the codebase for refresh_interval_ms and migrate all occurrences."],"exampleFix":"# before\npw.io.airbyte.read(..., refresh_interval_ms=30000)\n\n# after\nfrom datetime import timedelta\npw.io.airbyte.read(..., refresh_interval=timedelta(seconds=30))","handlingStrategy":"validation","validationCode":"from datetime import timedelta\n\ndef refresh_interval_arg(refresh_interval_ms: int | None,\n                         refresh_interval: int | float | timedelta | None):\n    if refresh_interval_ms is not None:\n        if refresh_interval is not None:\n            raise ValueError(\"pass only refresh_interval\")\n        refresh_interval = timedelta(milliseconds=refresh_interval_ms)\n    return {\"refresh_interval\": refresh_interval}\n\npw.io.airbyte.read(..., **refresh_interval_arg(refresh_interval_ms, refresh_interval))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After every pathway upgrade, grep for removed-parameter names (refresh_interval_ms, persistent_id).","Wrap connector calls in thin internal helpers so renames are fixed in one place."],"tags":["pathway","airbyte","deprecation","breaking-change","upgrade"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}