pathwaycom / pathwaycom/pathway

Introduce support for composite instance

Open
#150 0 comments 0 reactions 1 assignee View on GitHub

@zxqfd555 is already working on this.

Since Dec 31, 2025.

enhancement
Dominant language
Python
Stars
62.3k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
Some operators currently allow specifying an instance, for example, in window operators. However, in all tutorials and most examples, the instance is presented as a single field.

In practice, there are cases where it is necessary to define an instance composed of multiple components. This is already technically possible today, but it is not obvious to users how such a composite instance is represented and accessed.

Currently, the instance is available via pw.this._pw_instance, where individual components can be accessed as array elements:

  • index 0 corresponds to the first component,
  • index 1 to the second component,
  • and so on.

This behavior is non-obvious and poorly documented, which makes working with composite instances confusing for users.

Describe the solution you'd like
The solution consists of two parts:

  1. Expose the underlying _pw_instance in a more user-friendly way, so that users can access the instance directly via something like pw.this.instance. A more ergonomic API could be proposed here (suggestions are welcome).
  2. Add a clear example of using composite instances to the tutorials on the website.

Describe alternatives you've considered
Keeping the current behavior as-is.
This is a non-desired alternative, as user feedback indicates that composite instances are a real and recurring need.

Additional context
Since this change only involves making the existing _pw_instance mechanism publicly accessible, no breaking changes are expected. The solution should be fully backward-compatible.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.