{"record":{"id":"74c146ed4176cd0d","repo":"pathwaycom/pathway","slug":"input-table-has-a-column-column-r-but-it-is-not","errorCode":null,"errorMessage":"Input table has a column {column!r} but it is not present on the argument list of the invoke method.","messagePattern":"Input table has a column (.+?) but it is not present on the argument list of the invoke method\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/pathway/stdlib/utils/async_transformer.py","lineNumber":461,"sourceCode":"        instance_dtype = eval_type(input_table[_INSTANCE_COLUMN])\n        if not dt.is_hashable_in_python(instance_dtype):\n            raise ValueError(\n                f\"You can't use a column of type {instance_dtype} as instance in\"\n                + \" AsyncTransformer because it is unhashable.\"\n            )\n\n        self._input_table = input_table\n\n    def _check_signature_matches_schema(\n        self, sig: inspect.Signature, schema: type[Schema]\n    ) -> None:\n        try:\n            sig.bind(**schema.columns())\n        except TypeError as e:\n            msg = str(e)\n            if match := re.match(\"got an unexpected keyword argument '(.+)'\", msg):\n                column = match[1]\n                raise TypeError(\n                    f\"Input table has a column {column!r} but it is not present\"\n                    + \" on the argument list of the invoke method.\"\n                )\n            elif match := re.match(\"missing a required argument: '(.+)'\", msg):\n                arg_name = match[1]\n                raise TypeError(\n                    f\"Column {arg_name!r} is present on the argument list of the invoke\"\n                    + \" method but it is not present in the input_table.\"\n                )\n            raise e\n\n    def __init_subclass__(cls, /, output_schema: type[pw.Schema], **kwargs):\n        super().__init_subclass__(output_schema, **kwargs)\n\n    def with_options(\n        self,\n        capacity: int | None = None,\n        timeout: float | None = None,","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/stdlib/utils/async_transformer.py#L443-L479","documentation":"On construction, AsyncTransformer binds the input table's column names as keyword arguments against the signature of the user's invoke() method. If inspect's sig.bind fails with 'got an unexpected keyword argument', the transformer rewrites it into this TypeError naming the offending column: the table has a column the invoke() method does not accept.","triggerScenarios":"pw.AsyncTransformer(table, ...) where table has columns (q, metadata) but invoke(self, q) is defined; adding a helper column via with_columns before passing the table; a connector schema that includes extra fields not consumed by invoke().","commonSituations":"Adding an instance/key column to the table with with_columns before constructing the transformer; REST/Kafka connector schemas evolving to include new fields while invoke() stays unchanged; copy-pasting an AsyncTransformer subclass onto a new table with a wider schema.","solutions":["Add the missing parameter to invoke(), e.g. def invoke(self, q: str, metadata: str = None), if the column is useful","Otherwise project the table down before construction: pw.AsyncTransformer(input_table[['q', ...]], ...)","Give the extra invoke parameters default values so future extra columns bind cleanly"],"exampleFix":"# before\nclass E(pw.AsyncTransformer, output_schema=S):\n    def invoke(self, q: str) -> dict: ...\nout = E(t)  # t has columns q, metadata\n\n# after\nout = E(t.select('q'))  # or add `metadata: str = None` to invoke()","handlingStrategy":"validation","validationCode":"import inspect\nparams = set(inspect.signature(YourTransformer.invoke).parameters) - {'self'}\nmissing_on_invoke = set(input_table.schema.column_names()) - params\nassert not missing_on_invoke, f'columns not accepted by invoke(): {missing_on_invoke}'","typeGuard":"def invoke_accepts_all_columns(cls: type, table: pw.Table) -> bool:\n    import inspect\n    params = set(inspect.signature(cls.invoke).parameters) - {'self'}\n    return set(table.schema.column_names()) <= params","tryCatchPattern":null,"preventionTips":["Project the table with table[['col1', 'col2']] right before constructing the transformer","Give optional invoke() parameters default values so extra columns bind without failing","Run the signature-vs-schema check in a unit test for every transformer/table pairing"],"tags":["pathway","async","async-transformer","schema-mismatch","argument-validation"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}