#2850·taipy

[ BUG] Dynamic data_node_selector.datanodes error: Variable '__tpgc_dn_filter101' is not available

Author: arcanaxionCreated Apr 8, 2026Updated Aug 5, 2026

What went wrong?

This example allows the user to choose a dn config id ("x" or "y"), and updates the data_node_selector.datanodes property to filter its selector to just data nodes of that config id.

Example code
python
import taipy as tp
import taipy.gui.builder as tgb
from taipy import Config, Gui
from taipy.gui import notify

def square(x: int) -> int:
    return x**2

x_cfg = Config.configure_data_node(id="x", default_data=5)
y_cfg = Config.configure_data_node(id="y")
square_task_cfg = Config.configure_task(id="square", function=square, input=x_cfg, output=y_cfg)
scenario_cfg = Config.configure_scenario(id="scenario", task_configs=[square_task_cfg])

dn_cfg_id_list = ["x", "y"]
selected_dn_cfg_id = dn_cfg_id_list[0]
selected_data_node = None

with tgb.Page() as page:
    with tgb.part(class_name="container"):
        tgb.toggle(theme=True)
        tgb.text("# Dynamic data_node_selector.datanodes", mode="md")
        with tgb.layout(columns="1 1"):
            with tgb.part(class_name="card mb1"):
                tgb.selector(
                    "{selected_dn_cfg_id}",
                    lov="{dn_cfg_id_list}",
                    mode="radio",
                    label="Data node config id to select",
                    on_change=lambda state: notify(
                        state, "S", "Changed selected_dn_cfg_id to " + state.selected_dn_cfg_id
                    ),
                )

            with tgb.part(class_name="card mb1"):
                tgb.text("## Select data node:", mode="md")
                tgb.data_node_selector(
                    "{selected_data_node}",
                    datanodes="{[s.data_nodes[selected_dn_cfg_id] for s in tp.get_scenarios()]}",
                )
                tgb.data_node("{selected_data_node}")

if __name__ == "__main__":
    Config.configure_core()
    tp.Orchestrator().run()
    scenario_1 = tp.create_scenario(scenario_cfg, name="Scenario 1")
    scenario_1.data_nodes["x"].write(10)
    scenario_2 = tp.create_scenario(scenario_cfg, name="Scenario 2")
    Gui(page=page).run(title="Dynamic data_node_selector.datanodes", run_browser=False)

It works on the first connection. If I try to connect in another browser (or close the same browser and reconnect), when I click on an option in the radio box, I get the following issues:

  1. The data_node_selector does not update
  2. The selector's callback does not trigger (i.e. the notify does not happen)
  3. I get the following warning:
/home/.venv-develop/lib/python3.12/site-packages/taipy/gui/gui.py:2340: TaipyGuiWarning: Variable '__tpgc_dn_filter101' is not available in the '__main__' module.
  _warn(
/home/.venv-develop/lib/python3.12/site-packages/taipy/gui/gui.py:805: TaipyGuiWarning: A problem occurred while resolving variable 'selected_dn_cfg_id' in module '__main__'.
  _warn(

Steps to Reproduce

  1. Run the example code
  2. Open the application in a browser
  3. Open the application in another browser (or close and reopen the previous browser)
  4. Select an option in the radio box
  5. Error happens

Taipy Version

develop

Additional Context (Optional)

bash

Code of Conduct

  • I have checked the existing issues to avoid duplicates.
  • I am willing to work on this issue (optional)

✅ Acceptance Criteria

  • A reproducible unit test is added.
  • Code coverage is at least 90%.
  • The bug reporter validated the fix.
  • Relevant documentation updates or an issue created in