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

BUG-Data is not updated in the data section of Data Node viewer #950

Closed
2 tasks
FlorianJacta opened this issue Mar 8, 2024 · 0 comments · Fixed by #952
Closed
2 tasks

BUG-Data is not updated in the data section of Data Node viewer #950

FlorianJacta opened this issue Mar 8, 2024 · 0 comments · Fixed by #952
Assignees
Labels
Core Related to Taipy Core 🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟥 Priority: Critical Must be addressed as soon as possible
Milestone

Comments

@FlorianJacta
Copy link
Member

Description
The Data in the Data Node section of the Data Node viewer is not updated after executing a scenario. The only way to show the update is to refresh the page.

How to reproduce
Run this code. The initial value is 'District 1'. This is what can be seen inside both data node viewers. Change the district to 'District 2' and submit the scenario. What is inside the Data Node Viewer hasn't changed. It is still District 1 even after completion. Now, refresh the page. It is now District 2, as it should be.

from taipy.gui import Gui, notify
from taipy import Core, Config
import taipy as tp

import pandas as pd 

district_list = ["District 1", "District 2", "District 3"]
district_one = district_list[0]


def save(state):
    state.scenario.first_district_name.write(state.district_one)
    state.refresh('scenario')
    tp.gui.notify(state, 's', "Saved! Ready to Submit")


def iddle(first_district: str) -> str:
    return first_district


first_district_name_data_node_cfg = Config.configure_data_node(
    "first_district_name")
output_dn_cfg = Config.configure_data_node(
    "output_dn")
task_cfg = Config.configure_task(
    "task",
    iddle,
    input=first_district_name_data_node_cfg,
    output=output_dn_cfg
)

scenario_cfg = Config.configure_scenario(
    id="scenario", task_configs=[task_cfg]
)

Config.export('config.toml')

md = """
# Create your scenario:
<|{scenario}|scenario_selector|>

# Select the District to Compare

<|layout|columns=1 1|gap=30px|class_name=card|

<|container|
### District One
<|{district_one}|selector|lov={district_list}|on_change=save|dropdown|active={scenario}|>
|>
|>


# Run the **scenario**{:.color-primary}

<|layout|columns=1 1|

<|{scenario}|scenario|on_submission_change=follow_execution|>

<|{scenario}|scenario_dag|>
|>

# **Comparision Stats**{:.color-primary}
<|{scenario.output_dn}|data_node|>

<|{data_node}|data_node_selector|>

<|{data_node}|data_node|>
"""

data_node = None
def follow_execution(state, submittable, details):
    print(details['submission_status'])
    if details['submission_status'] == 'COMPLETED':
        state.refresh('scenario.output_dn')
        state.refresh('scenario')
        state.refresh('data_node')



if __name__ == "__main__":
    tp.Core().run()
    scenario = tp.create_scenario(scenario_cfg)
    scenario.first_district_name.write(district_one)
    tp.submit(scenario)

    print("Value at the end of task is",
          scenario.output_dn.read())

    tp.Gui(page=md).run(
        title="From Taipy Quine Quest-007", port=2445, host='0.0.0.0')

Expected behavior

The Data should be updated.

Runtime environment
Taipy: 3.1.0

Acceptance Criteria

  • Ensure new code is unit tested, and check code coverage is at least 90%
  • Create related issue in taipy-doc for documentation and Release Notes if relevant
@FlorianJacta FlorianJacta added Core Related to Taipy Core 🟥 Priority: Critical Must be addressed as soon as possible 🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. labels Mar 8, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Mar 8, 2024
FredLL-Avaiga pushed a commit that referenced this issue Mar 8, 2024
FredLL-Avaiga added a commit that referenced this issue Mar 9, 2024
* datanode update data
resolves #950

* format

---------

Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
FredLL-Avaiga pushed a commit that referenced this issue Mar 11, 2024
FredLL-Avaiga added a commit that referenced this issue Mar 11, 2024
#950 #908

Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
@FabienLelaquais FabienLelaquais added this to the Community 3.2 milestone Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Related to Taipy Core 🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟥 Priority: Critical Must be addressed as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants