pathwaycom/pathway · error · ValueError

designated_timestamp_policy="use_column" requires the design

Error message

designated_timestamp_policy="use_column" requires the designated_timestamp parameter to be set

What it means

Raised by pw.io.questdb.write when designated_timestamp_policy is set to 'use_column' but no designated_timestamp column argument was provided. The use_column policy means 'take the designated timestamp from a schema column'; without the column reference there is nothing to take, so the combination is rejected before any SQL is generated.

Source

Thrown at python/pathway/io/questdb/__init__.py:154

    designated_timestamp_index = None
    if designated_timestamp is not None:
        if (
            designated_timestamp_policy is not None
            and designated_timestamp_policy != "use_column"
        ):
            raise ValueError(
                f"designated_timestamp is passed, but designated_timestamp_policy is {designated_timestamp_policy}"
            )
        designated_timestamp_policy = "use_column"
        designated_timestamp_index = get_column_index(table, designated_timestamp)
        timestamp_dtype = table.schema.columns()[designated_timestamp.name].dtype
        if timestamp_dtype not in (dt.DATE_TIME_NAIVE, dt.DATE_TIME_UTC):
            raise ValueError(
                f"the designated_timestamp column {designated_timestamp.name!r} must have "
                f"type DateTimeNaive or DateTimeUtc, but it has type {timestamp_dtype}"
            )
    elif designated_timestamp_policy == "use_column":
        raise ValueError(
            'designated_timestamp_policy="use_column" requires the '
            "designated_timestamp parameter to be set"
        )
    elif designated_timestamp_policy is None:
        designated_timestamp_policy = "use_now"

    data_storage = api.DataStorage(
        storage_type="questdb",
        path=connection_string,
        table_name=table_name,
        key_field_index=designated_timestamp_index,
    )
    data_format = api.DataFormat(
        format_type="identity",
        key_field_names=[],
        value_fields=_format_output_value_fields(table),
        designated_timestamp_policy=designated_timestamp_policy,
    )

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Add the column reference: designated_timestamp=t.ts (typed DateTimeNaive/DateTimeUtc).
  2. If you have no suitable column, remove the policy argument to fall back to use_now (QuestDB assigns the server time).
  3. Audit config mapping code so policy and column are always set together (or neither).

Example fix

# before
pw.io.questdb.write(t, conn, "t", designated_timestamp_policy="use_column")

# after
pw.io.questdb.write(t, conn, "t", designated_timestamp=t.ts,
                    designated_timestamp_policy="use_column")
Defensive patterns

Strategy: validation

Validate before calling

if designated_timestamp_policy == "use_column":
    assert designated_timestamp is not None, "use_column requires designated_timestamp"
pw.io.questdb.write(t, conn, "t", designated_timestamp=designated_timestamp,
                    designated_timestamp_policy=designated_timestamp_policy)

Prevention

When it happens

Trigger: pw.io.questdb.write(t, conn, 't', designated_timestamp_policy='use_column') with the designated_timestamp parameter omitted or None.

Common situations: Config-driven connector wrappers that set the policy from a config file but map the column parameter only conditionally; refactors that removed the designated_timestamp argument but left the policy; misunderstanding that the policy alone does not name a column.

Related errors


AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15). Data as JSON: /api/errors/908e834c71674144. Report an issue: GitHub.