{"record":{"id":"99914e24ee8b75aa","repo":"pathwaycom/pathway","slug":"demo-range-stream-error-nb-rows-should-be-strictl","errorCode":null,"errorMessage":"demo.range_stream error: nb_rows should be strictly positive.","messagePattern":"demo\\.range_stream error: nb_rows should be strictly positive\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/demo/__init__.py","lineNumber":193,"sourceCode":"        nb_rows (int, optional): The number of rows to generate in the data stream. Defaults to 30.\n        offset (int, optional): The offset value added to the generated 'value' column. Defaults to 0.\n        input_rate (float, optional): The rate at which rows are generated per second. Defaults to 1.0.\n        autocommit_duration_ms: the maximum time between two commits. Every\n          autocommit_duration_ms milliseconds, the updates received by the connector are\n          committed and pushed into Pathway Live Data Framework's computation graph.\n\n    Returns:\n        pw.Table: a table containing the generated data stream.\n\n    Example:\n\n    >>> table = pw.demo.range_stream(nb_rows=50, offset=10, input_rate=2.5)\n\n    In the above example, an artificial data stream is generated with a single column 'value' and 50 rows.\n    The 'value' column contains values ranging from 'offset' (10 in this case) to 'nb_rows' + 'offset' (60).\n    \"\"\"\n    if nb_rows < 0:\n        raise ValueError(\n            \"demo.range_stream error: nb_rows should be strictly positive.\"\n        )\n\n    class InputSchema(pw.Schema):\n        value: float\n\n    value_generators = {\n        \"value\": (lambda x: float(x + offset)),\n    }\n    return generate_custom_stream(\n        value_generators=value_generators,\n        schema=InputSchema,\n        autocommit_duration_ms=autocommit_duration_ms,\n        nb_rows=nb_rows,\n        input_rate=input_rate,\n    )\n\n","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/demo/__init__.py#L175-L211","documentation":"pw.io.airbyte.read supports exactly two execution types: \"local\" (run the connector docker image locally) and \"remote\" (run on GCP Cloud Run). Any other string for execution_type is rejected before any work starts.","triggerScenarios":"Calling pw.io.airbyte.read(..., execution_type=\"docker\"), \"gcp\", \"cloud\", or any typo/case variant such as \"Local\".","commonSituations":"User guesses a value based on the underlying transport (docker image / cloud run) instead of the documented enum; or an old tutorial used a value renamed in a newer Pathway release.","solutions":["Set execution_type to \"local\" or \"remote\" exactly (lowercase).","Use \"local\" when the connector image can run on the host; use \"remote\" only together with service_user_credentials_file.","Omit execution_type if the default documented for your version is what you want."],"exampleFix":"# before\npw.io.airbyte.read(..., execution_type=\"docker\")\n\n# after\npw.io.airbyte.read(..., execution_type=\"local\")","handlingStrategy":"type-guard","validationCode":"if execution_type not in {\"local\", \"remote\"}:\n    raise ValueError(\"execution_type must be 'local' or 'remote'\")\npw.io.airbyte.read(..., execution_type=execution_type)","typeGuard":"from typing import Literal, TypeGuard\nExecutionType = Literal[\"local\", \"remote\"]\n\ndef is_execution_type(s: str) -> TypeGuard[ExecutionType]:\n    return s in {\"local\", \"remote\"}","tryCatchPattern":null,"preventionTips":["Type execution_type as Literal[\"local\", \"remote\"] in your config models.","Pull connector option enums from the Pathway docs of the pinned version, not from memory."],"tags":["pathway","airbyte","configuration","validation"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}