Avaiga / taipy

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

BUG- Scenario Viewer - Job is not accessible in on_submission_change #1197

Closed FlorianJacta closed 4 months ago

FlorianJacta commented 6 months ago

Description There are no keys for the 'job' in the details variable. We cannot provide correct user feedback.

This is not in line with the doc. image

How to reproduce

from taipy.config import Config
import taipy as tp
from taipy.gui import Gui, notify

Config.configure_job_executions(mode="standalone")

# Normal function used by Taipy
def double(nb):
    return nb * 2

# Configuration of Data Nodes
input_cfg = Config.configure_data_node(id="somedata", default_data=21)
output_cfg = Config.configure_data_node(id="result")

# Configuration of tasks
first_task_cfg = Config.configure_task(id="double",
                                       function=double,
                                       input=input_cfg,
                                       output=output_cfg)

# Configuration of scenario
scenario_cfg = Config.configure_scenario(id="my_scenario",
                                         task_configs=[first_task_cfg],
                                         name="my_scenario")

def notify_from_submissions(state, submittable, details):
    print(details.keys())

if __name__=="__main__":
    tp.Core().run()
    scenario_1 = tp.create_scenario(scenario_cfg)

    scenario_md = """
<|{scenario_1}|scenario|on_submission_change=notify_from_submissions|>
"""
    Gui(scenario_md).run()

image

Expected behavior There should be the job that changes the status of the scenario.

Runtime environment

Acceptance Criteria

jrobinAV commented 6 months ago

We need to add non-regression unit tests for these kinds of issues.

toan-quach commented 5 months ago

@jrobinAV this is due to the event publication is relying on the self_setter which only publish the attribute name and no extra information to go with it. In this case, we have to either change the documentation or find a way to change the self_setter function entirely

github-actions[bot] commented 4 months ago

This issue has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this issue, please add another comment or create a PR that links to this issue. If a PR has already been created which refers to this issue, then you should explicitly mention this issue in the relevant PR. Otherwise, you will be unassigned in 14 days. For more information please refer to the contributing guidelines.