pathwaycom/pathway · error · ValueError
demo.noisy_linear_stream error: nb_rows should be strictly p
Error message
demo.noisy_linear_stream error: nb_rows should be strictly positive.
What it means
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.
Source
Thrown at python/pathway/demo/__init__.py:137
"""
Generates an artificial data stream for the linear regression tutorial.
Args:
nb_rows (int, optional): The number of rows to generate in the data stream. Defaults to 10.
input_rate (float, optional): The rate at which rows are generated per second. Defaults to 1.0.
Returns:
pw.Table: A table containing the generated data stream.
Example:
>>> table = pw.demo.noisy_linear_stream(nb_rows=100, input_rate=2.0)
In the above example, an artificial data stream is generated with 100 rows. Each row has two columns, 'x' and 'y'.
The 'x' values range from 0 to 99, and the 'y' values are equal to 'x' plus some random noise.
"""
if nb_rows < 0:
raise ValueError(
"demo.noisy_linear_stream error: nb_rows should be strictly positive."
)
import random
random.seed(0)
def _get_value(i):
return float(i + (2 * random.random() - 1) / 10)
class InputSchema(pw.Schema):
x: float = pw.column_definition(primary_key=True)
y: float
value_generators = {
"x": (lambda x: float(x)),
"y": _get_value,
}
autocommit_duration_ms = 1000View on GitHub (pinned to fa2f74a464)
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.
Example fix
# before
pw.io.airbyte.read(..., execution_type="remote")
# after
pw.io.airbyte.read(
...,
execution_type="remote",
service_user_credentials_file="/secrets/gcp-sa.json",
) Defensive patterns
Strategy: validation
Validate before calling
if execution_type == "remote":
assert service_user_credentials_file, (
"execution_type='remote' requires service_user_credentials_file"
)
pw.io.airbyte.read(..., execution_type=execution_type,
service_user_credentials_file=service_user_credentials_file) Prevention
- 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.
When it happens
Trigger: Calling pw.io.airbyte.read(..., execution_type="remote") without the service_user_credentials_file argument (and no dependency_overrides providing it in tests).
Common situations: 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.
Related errors
- negative timestamp cannot be used
- only diffs of 1 and -1 are supported
- demo.range_stream error: nb_rows should be strictly positive
- Failed to install dependencies
- Column {api.TIME_PSEUDOCOLUMN} cannot contain negative times
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/bd9315f18ed8adc5.
Report an issue: GitHub.