Error message on on_change when creating Scenarios in scenario_selector
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",
)
βοΈ 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:
ce372d4by actionπ
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.
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
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