taipy icon indicating copy to clipboard operation
taipy copied to clipboard

Error message on on_change when creating Scenarios in scenario_selector

Open FredLL-Avaiga opened this issue 1 year ago β€’ 4 comments

resolves #2009

  • orchestration.py:
import taipy as tp
from taipy import Config, Orchestrator

node_config = Config.configure_data_node(id="test_node")

scenario_config = Config.configure_scenario(
    id="test_scenario",
    additional_data_node_configs=node_config,
)

orchestrator = Orchestrator()
orchestrator.run()

test_scenario = tp.create_scenario(scenario_config)
  • pages/scenario.py:
import taipy.gui.builder as tgb
from orchestration import test_scenario

selected_scenario = test_scenario


def notify_change(state, var, val):
    print(f"notify_change(var: {var}, val: {val})")


def notify_creation(state, var, val):
    print(f"notify_creation(var: {var}, val: {val})")

with tgb.Page() as buggy_page:
    tgb.scenario_selector(
        value="{selected_scenario}",
        show_pins=True,
        on_change=notify_change,
        on_creation=notify_creation,
    )

  • main.py:
from pages.scenario import buggy_page
from taipy.gui import Gui

if __name__ == "__main__":
    Gui(page=buggy_page).run(
        title="2009 [πŸ› BUG] Error message when creating Scenarios with scenario_selector",
    )

FredLL-Avaiga avatar Oct 16 '24 09:10 FredLL-Avaiga

β˜‚οΈ Python Coverage

current status: βœ…

Overall Coverage

Lines Covered Coverage Threshold Status
19089 16555 87% 0% 🟒

New Files

No new covered files...

Modified Files

File Coverage Status
taipy/gui_core/_context.py 52% 🟒
TOTAL 52% 🟒

updated for commit: ce372d4 by action🐍

github-actions[bot] avatar Oct 16 '24 09:10 github-actions[bot]

It would be good to have unit tests to ensure the new code is tested and to avoid future regressions.

We must increase the code coverage of this _context.py file. image

jrobinAV avatar Oct 16 '24 09:10 jrobinAV

Coverage report for ./frontend/taipy-gui

[!CAUTION] Coverage does not meet threshold Branches coverage not met for global: expected >=80%, but got 69.09315237507711%

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements 87.72% 3279/3738
🟑 Branches 69.09% 2240/3242
🟒 Functions 83.45% 605/725
🟒 Lines 88.23% 3037/3442

Test suite run success

648 tests passing in 44 suites.

Report generated by πŸ§ͺjest coverage report action from ce372d4fd7d62e765e475fa7690b073d994d53e4

github-actions[bot] avatar Oct 16 '24 14:10 github-actions[bot]

Coverage report for ./frontend/taipy

[!CAUTION] Coverage does not meet threshold Statements coverage not met for global: expected >=80%, but got 52.07920792079208%

St.:grey_question:
Category Percentage Covered / Total
πŸ”΄ Statements 52.08% 263/505
πŸ”΄ Branches 21.75% 67/308
πŸ”΄ Functions 14.66% 17/116
πŸ”΄ Lines 53.42% 242/453

Test suite run success

7 tests passing in 1 suite.

Report generated by πŸ§ͺjest coverage report action from ce372d4fd7d62e765e475fa7690b073d994d53e4

github-actions[bot] avatar Oct 16 '24 16:10 github-actions[bot]