Description 🔍 What went wrong?
Issues:
Filter by custom property not working
Value of date key in on_creation callback payload wrong?
Example code:
Details
import taipy as tp
import taipy .gui .builder as tgb
from taipy import Config , Gui , Scenario
from taipy .gui import State
def square (x : int ) -> int :
return x ** 2
x_cfg = Config .configure_data_node (id = "x" , default_data = 5 )
y_cfg = Config .configure_data_node (id = "y" )
square_task_cfg = Config .configure_task (id = "square" , function = square , input = x_cfg , output = y_cfg )
scenario_cfg = Config .configure_scenario (id = "scenario" , task_configs = [square_task_cfg ])
selected_scenario = None
def on_create_scenario (state : State , id : str , payload : dict ):
config = payload ["config" ]
date = payload ["date" ]
label = payload ["label" ]
properties = payload ["properties" ]
label += f" { date .strftime ('%Y-%m-%d %H:%M:%S' )} "
sc : Scenario = tp .create_scenario (config , name = label , creation_date = date )
sc .properties .update (properties )
sc .properties ["another_key" ] = "another_value"
return sc
with tgb .Page () as page :
tgb .toggle (theme = True )
with tgb .part (class_name = "container" ):
tgb .text ("# Select scenario:" , mode = "md" )
with tgb .layout (columns = "1 1" ):
tgb .scenario_selector ("{selected_scenario}" , on_creation = on_create_scenario , filter = ["another_key" , "Label" ])
tgb .scenario_selector ("{selected_scenario}" , on_creation = on_create_scenario )
tgb .scenario ("{selected_scenario}" )
if __name__ == "__main__" :
Config .configure_core ()
tp .Orchestrator ().run ()
Gui (page = page ).run (title = "Filter by Custom Property" , run_browser = False )
🔄 Steps to Reproduce
Custom property issue:
Create a scenario on the left
Observe that it was created with properties another_key = another_value
Try to filter "another_key contains value"
Observe that the selector is now empty (i.e. nothing matches)
No warning in terminal
Date issue:
Create a scenario on the left
Observe that the on_creation added the value of the callback's payload's date key to the label
Create another scenario on the left
Observe that the date is the same, even though time has passed
📦 Taipy Version
develop
📋 Additional Context (Optional)
📜 Code of Conduct
✅ Acceptance Criteria
Reactions are currently unavailable
You can’t perform that action at this time.
🔍 What went wrong?
Issues:
datekey inon_creationcallback payload wrong?Example code:
Details
🔄 Steps to Reproduce
Custom property issue:
another_key = another_valueDate issue:
datekey to the label📦 Taipy Version
develop
📋 Additional Context (Optional)
📜 Code of Conduct
✅ Acceptance Criteria