{"record":{"id":"ea9bd29c93687146","repo":"pathwaycom/pathway","slug":"self-name-has-no-attribute-name","errorCode":null,"errorMessage":"`{self.name}` has no attribute `{name}`","messagePattern":"`(.+?)` has no attribute `(.+?)`","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/graph_runner/row_transformer_operator_handler.py","lineNumber":290,"sourceCode":"        return TransformerReference(self)\n\n    def _with_class_arg(self, class_arg: rt.ClassArgMeta, id: api.Pointer):\n        return RowReference(\n            class_arg, self._context, self._mapping, self._operator_id, id\n        )\n\n    @trace.trace_user_frame\n    def __getattr__(self, name: str):\n        try:\n            if not self._class_arg._is_attribute(name):\n                return self._non_attribute_property(name)\n\n            table_index = self._class_arg._index\n            column_index = self._mapping.get(self._operator_id, table_index, name)\n            attribute = self._class_arg._get_attribute(name)\n        except AttributeError:\n            # Reraise with better message\n            raise AttributeError(f\"`{self.name}` has no attribute `{name}`\")\n\n        if attribute.is_method:\n\n            def func(*args):\n                return self._context.raising_get(column_index, self.id, *args)\n\n            return func\n        else:\n            return self._context.raising_get(column_index, self.id)\n\n    def _non_attribute_property(self, name: str) -> Any:\n        attr = self._class_arg._get_class_property(name)\n        if hasattr(attr, \"__get__\"):\n            return attr.__get__(self)\n        else:\n            return attr\n","sourceCodeStart":272,"sourceCodeEnd":307,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/graph_runner/row_transformer_operator_handler.py#L272-L307","documentation":"RowReference.__getattr__ wraps attribute lookup on a row inside a transformer: if the attribute is neither a column declared in the transformer's class arg schema (_is_attribute) nor a class-level property (_get_class_property), it re-raises AttributeError with '`{self.name}` has no attribute `{name}`'. The original exception is masked, so only the friendlier message is shown.","triggerScenarios":"Inside a row transformer, accessing self.<col> or ctx.<col> where <col> is not a field of the schema/class associated with the row; also triggered when the underlying _mapping.get lookup itself raises AttributeError for a stale operator id.","commonSituations":"Schema evolution: column renamed or removed from the input schema but transformer code still references it; typos in column names; referencing a column of a different table than the one the row belongs to.","solutions":["Add the missing attribute to the schema/class used by that row's table","Correct the attribute name to match an existing schema column (check for typos)","If the attribute is derived, expose it as a class property so _get_class_property finds it"],"exampleFix":"# before\nclass InputSchema(pw.Schema):\n    value: int\n\ndef transform_row(...)...\n    return self.value * 2, self.val  # 'val' does not exist\n\n# after\nclass InputSchema(pw.Schema):\n    value: int\n\n    # use the correct column name\n    return self.value * 2, self.value","handlingStrategy":"type-guard","validationCode":"cols = set(table.schema.column_names()) if hasattr(table, 'schema') else set(table._columns)\nassert col_name in cols, f\"{col_name!r} not in {sorted(cols)}\"","typeGuard":"def has_column(table, name: str) -> bool:\n    schema = getattr(table, 'schema', None)\n    names = schema.column_names() if schema is not None else table._columns.keys()\n    return name in names","tryCatchPattern":null,"preventionTips":["Define schemas as pw.Schema classes so typos surface as attribute errors on the schema first","After schema changes, grep transformer bodies for removed column names"],"tags":["pathway","row-transformer","attribute-error","schema","api-misuse"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}