{"record":{"id":"be8f5b977fc07bf5","repo":"pathwaycom/pathway","slug":"arguments-join-parameters-keys-have-to","errorCode":null,"errorMessage":"Arguments ({', '.join(parameters.keys())}) have to be of types {expected_types_string} but are of types {tuple(types.values())}.","messagePattern":"Arguments \\((.+?)\\) have to be of types (.+?) but are of types (.+?)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/pathway/stdlib/temporal/utils.py","lineNumber":79,"sourceCode":"        expected_types.append(\n            {\n                name: _get_possible_types(expected_type)[i]\n                for name, (_variable, expected_type) in parameters.items()\n            }\n        )\n    for ex_types in expected_types:\n        if all(\n            [\n                dt.dtype_issubclass(dtype, ex_dtype)\n                for (dtype, ex_dtype) in zip(types.values(), ex_types.values())\n            ]\n        ):\n            break\n    else:\n        expected_types_string = \" or \".join(\n            repr(tuple(ex_types.values())) for ex_types in expected_types\n        )\n        raise TypeError(\n            f\"Arguments ({', '.join(parameters.keys())}) have to be of types \"\n            + f\"{expected_types_string} but are of types {tuple(types.values())}.\"\n        )\n","sourceCodeStart":61,"sourceCodeEnd":83,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/stdlib/temporal/utils.py#L61-L83","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before (int epoch vs datetime)\nt2 = t2.with_columns(t2.ts.dt.to_datetime(unit='ms'))\nt1.interval_asof_join(t2, t1.ts, t2.ts, t1.delta, t2.delta, ...)\n\n# after (both datetime, durations already timedelta)\nt1.interval_asof_join(t2, t1.ts, t2.ts, t1.delta, t2.delta, ...)","handlingStrategy":"validation","validationCode":"from pathway import dt\nallowed = [(dt.INT, dt.INT), (dt.FLOAT, dt.FLOAT), (dt.DATE_TIME_NAIVE, dt.DURATION)]\ntypes = {n: dt.eval_type(c) for n, c in cols.items()}\nassert any(all(dt.dtype_issubclass(types[n], ex[n]) for n in types) for ex in allowed), f'bad dtype combo: {types}'","typeGuard":"def joint_temporal_types_ok(cols: dict[str, Any]) -> bool:\n    from pathway import dt\n    types = {n: dt.eval_type(c) for n, c in cols.items()}\n    combos = [(dt.INT, dt.INT), (dt.FLOAT, dt.FLOAT), (dt.DATE_TIME_NAIVE, dt.DURATION), (dt.DATE_TIME_UTC, dt.DURATION)]\n    return any(all(dt.dtype_issubclass(t, e) for t, e in zip(types.values(), combo)) for combo in combos)","tryCatchPattern":"try:\n    result = temporal_fn(...)\nexcept TypeError as e:\n    if 'have to be of types' in str(e):\n        raise TypeError(f'dtype mismatch, fix casts: {e}') from e\n    raise","preventionTips":["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"],"tags":["pathway","temporal","dtype-mismatch","argument-validation"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}