pathwaycom/pathway · error · OutOfScopeError

column out of scope

Error message

column out of scope

What it means

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.

Source

Thrown at python/pathway/internals/graph_runner/state.py:44

        self.columns = {}
        self.universes = {}
        self.computers = []
        self.legacy_tables = {}
        self.tables = {}
        self.storages = {}
        self.error_logs = {}

    def extract_universe(self, univ: universe.Universe) -> api.Universe:
        engine_table = self.get_table(univ)
        engine_universe = self.scope.table_universe(engine_table)
        self.set_universe(univ, engine_universe)
        return engine_universe

    def extract_column(self, column: column.Column) -> api.Column:
        univ = column.universe
        storage = self.get_storage(univ)
        if not storage.has_column(column):
            raise OutOfScopeError("column out of scope")
        engine_table = self.get_table(univ)
        if not self.has_universe(univ):
            engine_universe = self.extract_universe(univ)
        else:
            engine_universe = self.get_universe(univ)
        column_path = storage.get_path(column)
        engine_column = self.scope.table_column(
            engine_universe, engine_table, column_path
        )
        self.set_column(column, engine_column)
        return engine_column

    def create_table(self, universe: universe.Universe, storage: Storage) -> None:
        columns: list[api.Column] = []
        for col in storage.get_columns():
            if not isinstance(col, column.ExternalMaterializedColumn):
                columns.append(self.get_column(col))
        engine_table = self.scope.columns_to_table(self.get_universe(universe), columns)

View on GitHub (pinned to fa2f74a464)

Solutions

  1. If writing user code: report as a bug with a minimal reproducer; this error should not escape to users
  2. 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)
  3. Check that you are not mixing Column objects captured before a graph rebuild
Defensive patterns

Strategy: try-catch

Try / catch

from pathway.internals.graph_runner.state import OutOfScopeError

try:
    pw.io.csv.write(table, "out.csv")
except OutOfScopeError as e:
    raise RuntimeError("internal scope error; report to pathway with a minimal reproducer") from e

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15). Data as JSON: /api/errors/9f52b824d33289d8. Report an issue: GitHub.