pathwaycom/pathway · error · TypeError
Arguments ({', '.join(parameters.keys())}) have to be of typ
Error message
Arguments ({', '.join(parameters.keys())}) have to be of types {expected_types_string} but are of types {tuple(types.values())}. What it means
check_joint_types verifies that a group of columns handed to a temporal stdlib function form one of the allowed dtype combinations: (int, int), (float, float), or (datetime, timedelta) for a (time, interval) pair. The loop tries each expected combination using dt.dtype_issubclass; if none matches all arguments simultaneously, it raises TypeError listing the expected combinations and the actual dtypes. It fires at graph-construction time, before any data is processed.
Source
Thrown at python/pathway/stdlib/temporal/utils.py:79
expected_types.append(
{
name: _get_possible_types(expected_type)[i]
for name, (_variable, expected_type) in parameters.items()
}
)
for ex_types in expected_types:
if all(
[
dt.dtype_issubclass(dtype, ex_dtype)
for (dtype, ex_dtype) in zip(types.values(), ex_types.values())
]
):
break
else:
expected_types_string = " or ".join(
repr(tuple(ex_types.values())) for ex_types in expected_types
)
raise TypeError(
f"Arguments ({', '.join(parameters.keys())}) have to be of types "
+ f"{expected_types_string} but are of types {tuple(types.values())}."
)
View on GitHub (pinned to fa2f74a464)
Solutions
- Cast the mismatched columns so the pair matches: both int/float, or both datetime with a timedelta duration, e.g. table.dt.cast(dt.DATE_TIME_NAIVE) or table.dt.to_datetime() on the epoch column
- Convert int durations to timedelta with .dt.to_duration() (or apply(lambda ms: datetime.timedelta(milliseconds=ms)))
- Print table.schema_types() or pathway's dt.eval_type() on each argument to see which column has the wrong dtype before the call
Example fix
# before (int epoch vs datetime) t2 = t2.with_columns(t2.ts.dt.to_datetime(unit='ms')) t1.interval_asof_join(t2, t1.ts, t2.ts, t1.delta, t2.delta, ...) # after (both datetime, durations already timedelta) t1.interval_asof_join(t2, t1.ts, t2.ts, t1.delta, t2.delta, ...)
Defensive patterns
Strategy: validation
Validate before calling
from pathway import dt
allowed = [(dt.INT, dt.INT), (dt.FLOAT, dt.FLOAT), (dt.DATE_TIME_NAIVE, dt.DURATION)]
types = {n: dt.eval_type(c) for n, c in cols.items()}
assert any(all(dt.dtype_issubclass(types[n], ex[n]) for n in types) for ex in allowed), f'bad dtype combo: {types}' Type guard
def joint_temporal_types_ok(cols: dict[str, Any]) -> bool:
from pathway import dt
types = {n: dt.eval_type(c) for n, c in cols.items()}
combos = [(dt.INT, dt.INT), (dt.FLOAT, dt.FLOAT), (dt.DATE_TIME_NAIVE, dt.DURATION), (dt.DATE_TIME_UTC, dt.DURATION)]
return any(all(dt.dtype_issubclass(t, e) for t, e in zip(types.values(), combo)) for combo in combos) Try / catch
try:
result = temporal_fn(...)
except TypeError as e:
if 'have to be of types' in str(e):
raise TypeError(f'dtype mismatch, fix casts: {e}') from e
raise Prevention
- Standardize timestamp columns to one representation (datetime) right after ingestion with .dt.to_datetime()
- Express durations as datetime.timedelta columns, not raw ints, when timestamps are datetimes
- Log table.schema_types() for joined tables in tests so dtype drift is caught early
When it happens
Trigger: Mixing time representations, e.g. interval_asof_join with self_time as int and other_time as datetime.datetime; passing an int duration against a datetime timestamp; passing a float duration with a DATE_TIME_NAIVE time; one argument wrapped in an Optional/any dtype that is not a subclass of any allowed dtype.
Common situations: Joining tables whose timestamp columns were inferred differently (one parsed as int epoch, the other as datetime); passing Python ints as durations where the time column is datetime; schema drift after a source connector change (e.g. CSV column re-parsed as string); upgrading data pipelines where duration columns were previously timedelta and are now int.
Related errors
- The behavior argument of join should be of type pathway.temp
- Type has to be either TimeEventType or IntervalType.
- direction argument of join should be of type asof_join.Direc
- The interval argument of a join should be of a type pathway.
- Join received extra kwargs. You probably want to use TableLi
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/be8f5b977fc07bf5.
Report an issue: GitHub.