Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Pipeline the panel() method of first stage is run twice #1701

Closed
rafgonsi opened this issue Oct 27, 2020 · 0 comments · Fixed by #1705
Closed

In Pipeline the panel() method of first stage is run twice #1701

rafgonsi opened this issue Oct 27, 2020 · 0 comments · Fixed by #1705
Milestone

Comments

@rafgonsi
Copy link

ALL software version info

panel 0.10.0, bokeh 2.2.2, Python 3.7
OS: Manjaro 20.1.2

Description of expected behavior and the observed behavior

When using panel.pipeline.Pipeline sometimes the panel() method of the first stage of pipeline is called twice.

Complete, minimal, self-contained example code that reproduces the issue

import param
import panel as pn


class A(param.Parameterized):
    def panel(self):
        print("A.panel()")
        return self


class B(param.Parameterized):
    def panel(self):
        print("B.panel()")
        return self


pipeline = pn.pipeline.Pipeline(
    stages=[('A', A()), ('B', B())]
)
pn.Column(pipeline.buttons, pipeline.stage).servable()

After running this with panel serve bug_pipeline.py and opening in the browser, you see in console that 'A.panel()' was printed twice:
image

On the other hand if you declare stages differently, then the panel() method is run only once, as expected:

pipeline = pn.pipeline.Pipeline()
pipeline.add_stage('A', A())
pipeline.add_stage('B', B())
pn.Column(pipeline.buttons, pipeline.stage).servable()

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants