{"record":{"id":"bd9315f18ed8adc5","repo":"pathwaycom/pathway","slug":"demo-noisy-linear-stream-error-nb-rows-should-be","errorCode":null,"errorMessage":"demo.noisy_linear_stream error: nb_rows should be strictly positive.","messagePattern":"demo\\.noisy_linear_stream error: nb_rows should be strictly positive\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/demo/__init__.py","lineNumber":137,"sourceCode":"    \"\"\"\n    Generates an artificial data stream for the linear regression tutorial.\n\n    Args:\n        nb_rows (int, optional): The number of rows to generate in the data stream. Defaults to 10.\n        input_rate (float, optional): The rate at which rows are generated per second. Defaults to 1.0.\n\n    Returns:\n        pw.Table: A table containing the generated data stream.\n\n    Example:\n\n    >>> table = pw.demo.noisy_linear_stream(nb_rows=100, input_rate=2.0)\n\n    In the above example, an artificial data stream is generated with 100 rows. Each row has two columns, 'x' and 'y'.\n    The 'x' values range from 0 to 99, and the 'y' values are equal to 'x' plus some random noise.\n    \"\"\"\n    if nb_rows < 0:\n        raise ValueError(\n            \"demo.noisy_linear_stream error: nb_rows should be strictly positive.\"\n        )\n    import random\n\n    random.seed(0)\n\n    def _get_value(i):\n        return float(i + (2 * random.random() - 1) / 10)\n\n    class InputSchema(pw.Schema):\n        x: float = pw.column_definition(primary_key=True)\n        y: float\n\n    value_generators = {\n        \"x\": (lambda x: float(x)),\n        \"y\": _get_value,\n    }\n    autocommit_duration_ms = 1000","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/demo/__init__.py#L119-L155","documentation":"pw.io.airbyte.read with execution_type=\"remote\" runs the connector as a GCP Cloud Run job, which requires Google Cloud service-account credentials to be supplied. Without them Pathway cannot authenticate or submit the job, so it raises ValueError at setup time.","triggerScenarios":"Calling pw.io.airbyte.read(..., execution_type=\"remote\") without the service_user_credentials_file argument (and no dependency_overrides providing it in tests).","commonSituations":"Switching a working local airbyte setup to remote execution for production and forgetting the credentials file; or the path is configured via env var in one environment but not in CI/deployment.","solutions":["Pass service_user_credentials_file=\"/path/to/service-account.json\" with an account that can create/run Cloud Run jobs and write to the GCP region used.","If you did not intend remote execution, set execution_type=\"local\" (or omit it).","In tests, inject a fake via dependency_overrides instead of shipping real credentials."],"exampleFix":"# before\npw.io.airbyte.read(..., execution_type=\"remote\")\n\n# after\npw.io.airbyte.read(\n    ...,\n    execution_type=\"remote\",\n    service_user_credentials_file=\"/secrets/gcp-sa.json\",\n)","handlingStrategy":"validation","validationCode":"if execution_type == \"remote\":\n    assert service_user_credentials_file, (\n        \"execution_type='remote' requires service_user_credentials_file\"\n    )\npw.io.airbyte.read(..., execution_type=execution_type,\n    service_user_credentials_file=service_user_credentials_file)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the SA file path in an env var (e.g. GCP_SA_PATH) and fail fast in deployment scripts when unset.","Use dependency_overrides in tests so CI never needs real GCP credentials."],"tags":["pathway","airbyte","gcp","credentials","configuration"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}