pathwaycom/pathway · error · OutOfScopeError

path storage out of scope

Error message

path storage out of scope

What it means

GraphRunnerScope.get_storage raises OutOfScopeError('path storage out of scope') when the universe key is not in self.storages, i.e. no Storage (column path bookkeeping) was registered for that universe. Sister check to 'table out of scope'; both are set together by set_table, so seeing this one means set_table was never called or a different universe object identity was used.

Source

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

    def get_computer_logic(self, id: int) -> Callable:
        return self.computers[id]

    def get_table(self, key: universe.Universe) -> api.Table:
        if key not in self.tables:
            raise OutOfScopeError("table out of scope")
        return self.tables[key]

    def get_tables(self, keys: Iterable[universe.Universe]) -> list[api.Table]:
        return [self.get_table(key) for key in keys]

    def set_table(self, storage: Storage, table: api.Table) -> None:
        self.tables[storage._universe] = table
        self.storages[storage._universe] = storage

    def get_storage(self, key: universe.Universe) -> Storage:
        if key not in self.storages:
            raise OutOfScopeError("path storage out of scope")
        return self.storages[key]

    def get_storages(self, keys: Iterable[universe.Universe]) -> list[Storage]:
        return [self.get_storage(key) for key in keys]

    def set_error_log(self, table: table.Table, error_log: api.ErrorLog) -> None:
        self.error_logs[table] = error_log

    def get_error_log(self, table: table.Table) -> api.ErrorLog | None:
        # None is returned if the error_log is not used.
        # It was removed by tree shaking and there's no need to put entries in it.
        return self.error_logs.get(table)

View on GitHub (pinned to fa2f74a464)

Solutions

  1. If user code: report upstream; this is an internal invariant violation
  2. If custom operator: ensure set_table is called with the exact universe object obtained from the storage (storage._universe), not a reconstructed one
  3. Re-check the order in which your handler extracts universes/tables/storages
Defensive patterns

Strategy: try-catch

Try / catch

from pathway.internals.graph_runner.state import OutOfScopeError

try:
    ...  # custom operator handler body
except OutOfScopeError:
    # re-register the storage/table for the universe, or fail loudly
    raise

Prevention

When it happens

Trigger: get_storage called with a universe for which set_table(storage, table) was never invoked; using an equal-but-distinct Universe object as key (identity/hash mismatch) instead of the one registered.

Common situations: Custom operator development; internal refactors between pathway versions where universe identity semantics changed; not encountered in normal pipeline code.

Related errors


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