{"record":{"id":"5bed5e4ce9bd67db","repo":"pathwaycom/pathway","slug":"in-select-all-positional-arguments-have-to-be-a","errorCode":null,"errorMessage":"In select() all positional arguments have to be a ColumnReference.","messagePattern":"In select\\(\\) all positional arguments have to be a ColumnReference\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/arg_handlers.py","lineNumber":202,"sourceCode":"                raise ValueError(\n                    f\"Expected a ColumnReference, found a string. Did you mean this.{arg} instead of {repr(arg)}?\"\n                )\n            else:\n                raise ValueError(\n                    \"In reduce() all positional arguments have to be a ColumnReference.\"\n                )\n    return (self, *args), kwargs\n\n\ndef select_args_handler(self, *args, **kwargs):\n    for arg in args:\n        if not isinstance(arg, expr.ColumnReference):\n            if isinstance(arg, str):\n                raise ValueError(\n                    f\"Expected a ColumnReference, found a string. Did you mean this.{arg} instead of {repr(arg)}?\"\n                )\n            else:\n                raise ValueError(\n                    \"In select() all positional arguments have to be a ColumnReference.\"\n                )\n    return (self, *args), kwargs\n","sourceCodeStart":184,"sourceCodeEnd":206,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/arg_handlers.py#L184-L206","documentation":"Table.select()'s argument preprocessor found a positional argument that is not a ColumnReference and not a string — e.g. an integer, list, or arbitrary expression object. select() positionals must be existing column references; all computed values must be supplied as named keyword arguments.","triggerScenarios":"Calling table.select(t.price + 1) positionally, table.select(1), or table.select([t.a, t.b]) (a list instead of unpacked references).","commonSituations":"Passing a list of columns collected programmatically without unpacking with *; forgetting that expressions in select must be named kwargs (col=t.price + 1).","solutions":["Unpack lists: table.select(*cols) instead of table.select(cols).","Name computed expressions: table.select(total=t.price + 1).","Remove literal/constant positionals; constants belong in kwargs (e.g. one=1)."],"exampleFix":"# before\nt.select([t.a, t.b])\nt.select(t.price + 1)\n\n# after\nt.select(*[t.a, t.b])\nt.select(total=t.price + 1)","handlingStrategy":"type-guard","validationCode":"import pathway.internals.expression as expr\nassert all(isinstance(a, expr.ColumnReference) for a in args), 'select() positionals must be ColumnReference; unpack lists and name computed columns'","typeGuard":"import pathway.internals.expression as expr\n\ndef select_positionals_ok(args) -> bool:\n    return all(isinstance(a, expr.ColumnReference) for a in args)","tryCatchPattern":null,"preventionTips":["Unpack lists: select(*cols).","Computed expressions always as kwargs: select(total=expr)."],"tags":["pathway","select","argument-validation"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}