The scenario selector doesn't automatically select the new scenario when creating a scenario. It is also impossible to select any scenario afterward.
After a page refresh, it is possible.
C:\Users\jacta\.conda\envs\patch\Lib\site-packages\taipy\gui\gui.py:707: TaipyGuiWarning: Decoding Message has failed: {'type': 'RU', 'name': '', 'payload': {'id': '', 'names': ['_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter31_tpgc_sc_sort31_tgc_scenario_TPMDL_1_0'], 'refresh': True}, 'propagate': True, 'client_id': '20241028105504955673-0.5756708616347557', 'ack_id': 'XPtMYBUOXA5fZMEd4iGvF', 'module_context': '__main__'}:
'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter31_tpgc_sc_sort31_tgc_scenario_TPMDL_1_0'
_warn(f"Decoding Message has failed: {message}", e)
C:\Users\jacta\.conda\envs\patch\Lib\site-packages\taipy\gui\gui.py:707: TaipyGuiWarning: Decoding Message has failed: {'type': 'RU', 'name': '', 'payload': {'id': '', 'names': ['_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter31_tpgc_sc_sort31_tgc_scenario_TPMDL_1_0'], 'refresh': True}, 'propagate': True, 'client_id': '20241028105504955673-0.5756708616347557', 'ack_id': 'yTk9bU2I-RhhV0eKW2usd', 'module_context': '__main__'}:
'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter31_tpgc_sc_sort31_tgc_scenario_TPMDL_1_0'
_warn(f"Decoding Message has failed: {message}", e)
C:\Users\jacta\.conda\envs\patch\Lib\site-packages\taipy\gui\gui.py:707: TaipyGuiWarning: Decoding Message has failed: {'type': 'RU', 'name': '', 'payload': {'id': '', 'names': ['_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter31_tpgc_sc_sort31_tgc_scenario_TPMDL_1_0'], 'refresh': True}, 'propagate': True, 'client_id': '20241028105504955673-0.5756708616347557', 'ack_id': 'JylotNvl52oD5pWwU_K3d', 'module_context': '__main__'}:
'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter31_tpgc_sc_sort31_tgc_scenario_TPMDL_1_0'
_warn(f"Decoding Message has failed: {message}", e)
C:\Users\jacta\.conda\envs\patch\Lib\site-packages\taipy\gui\gui.py:707: TaipyGuiWarning: Decoding Message has failed: {'type': 'RU', 'name': '', 'payload': {'id': '', 'names': ['_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter71_tpgc_sc_sort71_tgc_scenario_TPMDL_1_0'], 'refresh': True}, 'propagate': True, 'client_id': '20241028105504955673-0.5756708616347557', 'ack_id': 'w_N7MX6S565zCoJmvEsv5', 'module_context': '__main__'}:
'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter71_tpgc_sc_sort71_tgc_scenario_TPMDL_1_0'
_warn(f"Decoding Message has failed: {message}", e)
Expected Behavior
This is a regression. It should work like before. Creating a scenario through the scenario selector should select the newly created scenario. You should also be able to change the chosen scenario afterward.
Steps to Reproduce Issue
Run the app,
Create a scenario (this scenario is not selected),
Try to change the selected scenario (nothing happens).
from taipy import Config, Frequency
import taipy as tp
import pandas as pd
import datetime as dt
import taipy.gui.builder as tgb
data = pd.read_csv(
"https://raw.githubusercontent.com/Avaiga/taipy-getting-started-core/develop/src/daily-min-temperatures.csv"
)
# Normal function used by Taipy
def predict(
historical_temperature: pd.DataFrame, date_to_forecast: dt.datetime
) -> float:
print(f"Running baseline...")
historical_temperature["Date"] = pd.to_datetime(historical_temperature["Date"])
historical_same_day = historical_temperature.loc[
(historical_temperature["Date"].dt.day == date_to_forecast.day)
& (historical_temperature["Date"].dt.month == date_to_forecast.month)
]
return historical_same_day["Temp"].mean()
# Configuration of Data Nodes
historical_temperature_cfg = Config.configure_data_node("historical_temperature")
date_to_forecast_cfg = Config.configure_data_node("date_to_forecast")
predictions_cfg = Config.configure_data_node("predictions", storage_type="json")
# Configuration of tasks
predictions_cfg = Config.configure_task(
"predict",
predict,
[historical_temperature_cfg, date_to_forecast_cfg],
predictions_cfg,
)
# Configuration of scenario
scenario_cfg = Config.configure_scenario(
id="my_scenario", task_configs=[predictions_cfg], frequency=Frequency.MONTHLY
)
if __name__ == "__main__":
# Run of the Core
tp.Core().run()
# Creation of the scenario and execution
scenario = tp.create_scenario(scenario_cfg)
tp.create_scenario(scenario_cfg, name="Hello World")
with tgb.Page() as page:
tgb.scenario_selector("{scenario}")
tgb.scenario("{scenario}")
tp.Gui(page).run()
Version of Taipy
4.0.1.dev0
Acceptance Criteria
[ ] A unit test reproducing the bug is added.
[ ] Any new code is covered by a unit tested.
[ ] Check code coverage is at least 90%.
[ ] The bug reporter validated the fix.
[ ] Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.
What went wrong? π€
The scenario selector doesn't automatically select the new scenario when creating a scenario. It is also impossible to select any scenario afterward.
After a page refresh, it is possible.
Expected Behavior
This is a regression. It should work like before. Creating a scenario through the scenario selector should select the newly created scenario. You should also be able to change the chosen scenario afterward.
Steps to Reproduce Issue
Version of Taipy
4.0.1.dev0
Acceptance Criteria
Code of Conduct