Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
9.75k stars 692 forks source link

[🐛 BUG] Errors when using Scenario Selector visual element #1451

Open FlorianJacta opened 1 week ago

FlorianJacta commented 1 week ago

What went wrong? 🤔

When creating a scenario in the Scenario Selector, nothing happens, and the Python console shows many errors.

It seems to be due to filters even if the Scenario Selector has no filter.

I couldn't replicate/isolate the issue in a simple example.

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: 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_filter801_tpgc_sc_sort801_tgc_scenario_TPMDL_5_0'], 'refresh': True}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': 'b6afa6e0-d2fa-4a79-95ae-14d199315430', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter801_tpgc_sc_sort801_tgc_scenario_TPMDL_5_0'

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: 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_filter801_tpgc_sc_sort801_tgc_scenario_TPMDL_5_0'], 'refresh': True}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': 'b7a86bb8-1f1b-4959-9648-a51f7dab2ce6', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter801_tpgc_sc_sort801_tgc_scenario_TPMDL_5_0'

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: 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_filter1311_tpgc_sc_sort1311_tgc_scenario_TPMDL_5_0'], 'refresh': True}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': 'f01fb1bf-7674-4987-87df-bbe08be59e2c', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter1311_tpgc_sc_sort1311_tgc_scenario_TPMDL_5_0'

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: 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_filter1311_tpgc_sc_sort1311_tgc_scenario_TPMDL_5_0'], 'refresh': True}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': 'e064ea0f-2945-4aae-be73-e78db70e5c80', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter1311_tpgc_sc_sort1311_tgc_scenario_TPMDL_5_0'

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: 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_filter801_tpgc_sc_sort801_tgc_scenario_TPMDL_5_0'], 'refresh': True}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': 'e014a45f-2d05-433b-a37a-126422bde457', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter801_tpgc_sc_sort801_tgc_scenario_TPMDL_5_0'

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: 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_filter801_tpgc_sc_sort801_tgc_scenario_TPMDL_5_0'], 'refresh': True}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': 'a03c1e88-5744-4a5c-9a42-b66188e504f1', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpL_tp_TpExPr_gui_get_adapted_lov_taipy_gui_core_Ctx_get_scenarios_None_tpgc_sc_filter801_tpgc_sc_sort801_tgc_scenario_TPMDL_5_0'

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:654: TaipyGuiWarning:

A problem occurred while resolving variable 'tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id771_TPMDL_5_0' in module '__main__'.

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:654: TaipyGuiWarning:

A problem occurred while resolving variable 'tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id1281_TPMDL_5_0' in module '__main__'.

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:654: TaipyGuiWarning:

A problem occurred while resolving variable 'tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id771_TPMDL_5_0' in module '__main__'.

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:654: TaipyGuiWarning:

A problem occurred while resolving variable 'tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id771_TPMDL_5_0' in module '__main__'.

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: TaipyGuiWarning:

Decoding Message has failed: {'type': 'RU', 'name': '', 'payload': {'id': '', 'names': ['_TpD_tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id771_TPMDL_5_0', 'tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_columns_tpgc_dv_data_id771_TPMDL_5_0'], 'refresh': True, 'state_context': {'__tpgc_dv_data_id771': 'DATANODE_holiday_386bb6ef-9d8b-400d-b46a-b6e827b27150'}}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': '872b323f-aabc-4979-9054-f4a959422839', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpD_tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id771_TPMDL_5_0'

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: TaipyGuiWarning:

Decoding Message has failed: {'type': 'RU', 'name': '', 'payload': {'id': '', 'names': ['_TpD_tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id1281_TPMDL_5_0', 'tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_columns_tpgc_dv_data_id1281_TPMDL_5_0'], 'refresh': True, 'state_context': {'__tpgc_dv_data_id1281': 'DATANODE_holiday_386bb6ef-9d8b-400d-b46a-b6e827b27150'}}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': '5b120646-866a-4656-a54e-c3b4b3900552', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpD_tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id1281_TPMDL_5_0'

C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py:661: TaipyGuiWarning:

Decoding Message has failed: {'type': 'RU', 'name': '', 'payload': {'id': '', 'names': ['_TpD_tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id771_TPMDL_5_0', 'tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_columns_tpgc_dv_data_id771_TPMDL_5_0'], 'refresh': True, 'state_context': {'__tpgc_dv_data_id771': 'DATANODE_holiday_386bb6ef-9d8b-400d-b46a-b6e827b27150'}}, 'propagate': True, 'client_id': '20240209123958813895-0.3560967328471696', 'ack_id': 'e14db6c9-5251-4d4b-9412-5fa8237adee0', 'module_context': 'pages.Predictions.Predictions'}:
Traceback (most recent call last):
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 632, in _manage_message  
    self.__request_var_update(message.get("payload"))
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\gui.py", line 1105, in __request_var_update
    val = _getscopeattr_drill(self, _var)
  File "C:\Users\jacta\.conda\envs\develop\lib\site-packages\taipy\gui\utils\_attributes.py", line 26, in _getscopeattr_drill
    return attrgetter(name)(gui._get_data_scope())
AttributeError: 'types.SimpleNamespace' object has no attribute '_TpD_tp_TpExPr_taipy_gui_core_Ctx_get_data_node_tabular_data_tpgc_dv_data_id771_TPMDL_5_0'

Expected Behavior

I should be able to add a scenario and see it in the list. The scenario is correctly added but it is not true in the UI.

Steps to Reproduce Issue

Clone this code, run it and create a scenario in the Scenario page.

I guess you should also apply filters that are not correct for this application.

Version of Taipy

Develop 6/26/24

Acceptance Criteria

Code of Conduct

FredLL-Avaiga commented 1 week ago

Not related to filter or sort. can you provide your app ?

FlorianJacta commented 1 week ago

The code is here. Do you have access?

FlorianJacta commented 1 week ago

My guess was that I run two different applications one after the other on the same port without clearing my local storage. After I cleared the local storage, I didn't see these issues anymore

FredLL-Avaiga commented 1 week ago

Can you confirm/close then ?

FlorianJacta commented 1 week ago

This needs more investigation. I have spent some hours on it last time; I'll try to investigate it more

FredLL-Avaiga commented 5 days ago

the filter definition is indeed stored in localstorage (which is specific to the app URL) The key is the element id (if any) + "innerScenarios" + "filter"