# Interactive does not work as expected

**URL:** <https://discourse.holoviz.org/t/interactive-does-not-work-as-expected/4095>\
**Category:** hvPlot\
**Tags:** interactive\
**Created:** [August 12, 2022, 8:14am UTC](https://discourse.holoviz.org/t/interactive-does-not-work-as-expected/4095 "2022-08-12T08:14:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stubatiger](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/stubatiger/32/2539_2.png) [@Stubatiger](https://discourse.holoviz.org/u/Stubatiger)\
**Post date:** [August 12, 2022, 8:14am UTC](https://discourse.holoviz.org/t/interactive-does-not-work-as-expected/4095/1 "2022-08-12T08:14:44Z")

</div>

Hello,  
im trying to build a data pipeline with .interactive and a function as a pipeline start as described in [Interactive — hvPlot 0.8.0 documentation](https://hvplot.holoviz.org/user_guide/Interactive.html#functions-as-inputs)

I was assuming that an interactive pipeline is only run once at the end and that it updates only  
at the steps where the parameters are changing.  
But apparently it runs the pipeline for each added step multiple times?  
Can anyone explain my the following output of the code?

```python
import panel as pn
import pandas as pd
import hvplot

dataconfig = pn.widgets.Select(options=["Conf1", "Conf2"])

def load_data(dataconfig):
    print("Load Data")
    return pd.DataFrame([{"config": dataconfig}])

def transform_data(df, transform):
    print(f"Transforming {transform}")
    return df

print("-------------")

bound_loader = hvplot.bind(load_data, dataconfig)

print("-------------")

interactive_loader = bound_loader.interactive()

print("-------------")

transformed_loader = interactive_loader.pipe(transform_data, transform="Step 1")

print("-------------")

transformed_loader = transformed_loader.pipe(transform_data, transform="Step 2")

print("-------------")

transformed_loader = transformed_loader.pipe(transform_data, transform="Step 3")

```

The output of this is

```auto
-------------
-------------
Load Data
Load Data
-------------
Transforming Step 1
-------------
Transforming Step 1
Transforming Step 1
Transforming Step 1
Transforming Step 2
-------------
Transforming Step 1
Transforming Step 2
Transforming Step 1
Transforming Step 2
Transforming Step 1
Transforming Step 2
Transforming Step 3

```

And i dont unterstand why the functions get called so many times?

---

<div class="post-metadata">

**Author:** ![maximlt](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/maximlt/32/2487_2.png) [@maximlt](https://discourse.holoviz.org/u/maximlt)\
**Post date:** [August 12, 2022, 9:04am UTC](https://discourse.holoviz.org/t/interactive-does-not-work-as-expected/4095/2 "2022-08-12T09:04:51Z")

</div>

Hi @Stubatiger,

Thanks for reporting that. In your example you can see that `load_data` is called twice, this is a bug we have recently fixed and that should be released shortly. However the other issue you reported - i.e. the many calls to the piped function - is a bug we were not aware of, I’ve just opened an issue to track it: [Interactive: using `.pipe`/`.apply` in a pipeline triggers the piped/applied function too many times · Issue #832 · holoviz/hvplot · GitHub](https://github.com/holoviz/hvplot/issues/832)

Thanks for raising that!

---

<div class="post-metadata">

**Author:** ![Stubatiger](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/stubatiger/32/2539_2.png) [@Stubatiger](https://discourse.holoviz.org/u/Stubatiger)\
**Post date:** [August 12, 2022, 9:29am UTC](https://discourse.holoviz.org/t/interactive-does-not-work-as-expected/4095/3 "2022-08-12T09:29:21Z")

</div>

Hey thanks for the quick feedbag,

can you link me the pr for the fix of the load\_data function?

And if you have ideas where to start looking for the other bug, i could make some digging 🙂
