pathwaycom/pathway · error · ValueError
Invalid schema. Time columns must be int or float.
Error message
Invalid schema. Time columns must be int or float.
What it means
At runtime, _PathwayAirbyteSubject dispatches each record either to the incremental path (forward payload and manage state) or the full_refresh path (dedup cache via api.ref_scalar). Unknown sync_mode values fall through to a RuntimeError — an internal invariant guard after the catalog validation in pw.io.airbyte.read.
Source
Thrown at python/pathway/demo/__init__.py:290
schema: Schema of the resulting table.
time_column: Column containing the timestamps.
unit: Unit of the timestamps. Only 's', 'ms', 'us', and 'ns' are supported. Defaults to 's'.
autocommit_duration_ms: the maximum time between two commits. Every
autocommit_duration_ms milliseconds, the updates received by the connector are
committed and pushed into Pathway Live Data Framework's computation graph.
speedup: Produce stream `speedup` times faster than it would result from the time column.
Returns:
Table: The table read.
Note: the CSV files should follow a standard CSV settings. The separator is ',', the
quotechar is '"', and there is no escape.
"""
time_column_type = schema.typehints().get(time_column, None)
if time_column_type != int and time_column_type != float:
raise ValueError("Invalid schema. Time columns must be int or float.")
if unit not in ["s", "ms", "us", "ns"]:
raise ValueError(
"demo.replay_csv_with_time: unit should be either 's', 'ms, 'us', or 'ns'."
)
unit_factor = 1
match unit:
case "ms":
unit_factor = 1000
case "us":
unit_factor = 1_000_000
case "ns":
unit_factor = 1_000_000_000
case _:
unit_factor = 1
speedup *= unit_factor
View on GitHub (pinned to fa2f74a464)
Solutions
- If building the subject/source manually, ensure every catalog stream uses sync_mode "incremental" or "full_refresh".
- Re-run through pw.io.airbyte.read so the catalog validation in python/pathway/io/airbyte/__init__.py catches bad values before runtime.
- If it reproduces with a plain pw.io.airbyte.read call, report it as a Pathway bug with the catalog JSON.
Defensive patterns
Strategy: try-catch
Validate before calling
for s in source.configured_catalog["streams"]:
assert s["sync_mode"] in {"incremental", "full_refresh"}, s Try / catch
try:
pw.run()
except RuntimeError as e:
if "Unknown sync_mode" in str(e):
raise ValueError(f"misconfigured airbyte catalog: {e}") from e
raise Prevention
- Always go through pw.io.airbyte.read rather than constructing the subject directly.
- Validate the whole catalog (all streams' sync_mode) before building the pipeline.
When it happens
Trigger: The configured catalog passed the earlier per-stream checks in a way that left a sync_mode value other than incremental/full_refresh reaching the record-dispatch branch — e.g. a catalog mutated after construction, a monkeypatched source, or a version mismatch between validation constants and logic.
Common situations: Rare in normal use; appears when constructing _PathwayAirbyteSubject directly with a hand-built catalog, or when airbyte-related code paths are overridden in tests (dependency_overrides) with inconsistent sync_mode values.
Related errors
- demo.replay_csv_with_time: unit should be either 's', 'ms, '
- negative timestamp cannot be used
- only diffs of 1 and -1 are supported
- demo.generate_custom_stream error: nb_rows should be None or
- demo.noisy_linear_stream error: nb_rows should be strictly p
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/8a0ec60c987775e0.
Report an issue: GitHub.