{"record":{"id":"9f52b824d33289d8","repo":"pathwaycom/pathway","slug":"column-out-of-scope","errorCode":null,"errorMessage":"column out of scope","messagePattern":"column out of scope","errorType":"exception","errorClass":"OutOfScopeError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/graph_runner/state.py","lineNumber":44,"sourceCode":"        self.columns = {}\n        self.universes = {}\n        self.computers = []\n        self.legacy_tables = {}\n        self.tables = {}\n        self.storages = {}\n        self.error_logs = {}\n\n    def extract_universe(self, univ: universe.Universe) -> api.Universe:\n        engine_table = self.get_table(univ)\n        engine_universe = self.scope.table_universe(engine_table)\n        self.set_universe(univ, engine_universe)\n        return engine_universe\n\n    def extract_column(self, column: column.Column) -> api.Column:\n        univ = column.universe\n        storage = self.get_storage(univ)\n        if not storage.has_column(column):\n            raise OutOfScopeError(\"column out of scope\")\n        engine_table = self.get_table(univ)\n        if not self.has_universe(univ):\n            engine_universe = self.extract_universe(univ)\n        else:\n            engine_universe = self.get_universe(univ)\n        column_path = storage.get_path(column)\n        engine_column = self.scope.table_column(\n            engine_universe, engine_table, column_path\n        )\n        self.set_column(column, engine_column)\n        return engine_column\n\n    def create_table(self, universe: universe.Universe, storage: Storage) -> None:\n        columns: list[api.Column] = []\n        for col in storage.get_columns():\n            if not isinstance(col, column.ExternalMaterializedColumn):\n                columns.append(self.get_column(col))\n        engine_table = self.scope.columns_to_table(self.get_universe(universe), columns)","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/graph_runner/state.py#L26-L62","documentation":"GraphRunnerScope.extract_column raises OutOfScopeError('column out of scope') when the Storage for the column's universe does not contain that column (storage.has_column(column) is False). It is an engine-side scope-tracking failure: the graph runner is asked to materialize a column it never registered, typically a symptom of incorrect internal API usage rather than a user-typo problem.","triggerScenarios":"Building engine column objects via GraphRunnerScope.extract_column for a Column whose containing Storage was not populated in this scope; happens when operators capture columns from a different graph/scope or when scope extraction order is violated.","commonSituations":"Extending Pathway internals (custom operators) that reference columns across scopes; reusing Column objects after the storage graph changed; bugs in operator handlers during version upgrades of pathway internals.","solutions":["If writing user code: report as a bug with a minimal reproducer; this error should not escape to users","If writing a custom operator: ensure the column's universe/storage is registered in the same GraphRunnerScope before extraction (call set_table/extract_universe first)","Check that you are not mixing Column objects captured before a graph rebuild"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from pathway.internals.graph_runner.state import OutOfScopeError\n\ntry:\n    pw.io.csv.write(table, \"out.csv\")\nexcept OutOfScopeError as e:\n    raise RuntimeError(\"internal scope error; report to pathway with a minimal reproducer\") from e","preventionTips":["Pin your pathway version; these invariants break across internal refactors","If you build custom operators, always extract universes/tables via the scope in dependency order"],"tags":["pathway","internals","graph-runner","scope","internal-error"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}