Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack broadcasts so that not one is lost #1882

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

FredLL-Avaiga
Copy link
Member

resolves #1608

import datetime as dt

import taipy as tp
from taipy import Config, Frequency

Config.configure_job_executions(mode="standalone", max_nb_of_workers=2)


# Function to run a Dataiku scenario
def run_something(input_1, input_2):
    datetime = dt.datetime.now()
    date = dt.date(2018, 1, 1)
    int_var = 10
    string_var = "String"
    return datetime, date, int_var, string_var


data = {
    "toto": list(range(10_000)),
    "titi": [2 * i for i in range(10_000)],
    "tata": [4 * i for i in range(10_000)],
}


input_1_cfg = Config.configure_data_node(
    id="input_1_data_node",
    default_data=1,
)


input_2_cfg = Config.configure_data_node(
    id="input_2_data_node",
    default_data=data,
)

datetime_cfg = Config.configure_data_node(id="datetime_data_node")
date_cfg = Config.configure_data_node(id="date_data_node")
int_cfg = Config.configure_data_node(id="int_data_node")
string_cfg = Config.configure_data_node(id="string_data_node")


# Scenario and task configuration in Taipy
scenario_task_cfg = Config.configure_task(
    id="scenario_task",
    function=run_something,
    input=[input_1_cfg, input_2_cfg],
    output=[datetime_cfg, date_cfg, int_cfg, string_cfg],
)

scenario_cfg = Config.configure_scenario(id="scenario", task_configs=[scenario_task_cfg], frequency=Frequency.DAILY)

data_node = None
# GUI Markdown content
scenario_md = """
<|{scenario}|scenario_selector|>

<|{data_node}|data_node|>

<|{scenario}|scenario|>
"""


def on_change(state, var_name, var_value):
    if var_name == "scenario" and isinstance(var_value, tp.Scenario):
        state.data_node = state.scenario.input_1_data_node


# Main execution block with GUI setup
if __name__ == "__main__":
    tp.Orchestrator().run()
    scenario = tp.create_scenario(scenario_cfg)

    tp.Gui(scenario_md).run(title="1608 submit inactive after data lock")

@FredLL-Avaiga FredLL-Avaiga added Core Related to Taipy Core 🟥 Priority: Critical Must be addressed as soon as possible 💥Malfunction Addresses an identified problem. GUI: Front-End labels Oct 2, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Oct 2, 2024
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

frontend/taipy/package.json Outdated Show resolved Hide resolved
frontend/taipy/src/utils.ts Show resolved Hide resolved
frontend/taipy-gui/packaging/taipy-gui.d.ts Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Oct 2, 2024

Coverage report for ./frontend/taipy-gui

Caution

Coverage does not meet threshold
Branches coverage not met for global: expected >=80%, but got 68.99875621890547%

St.
Category Percentage Covered / Total
🟢 Statements
87.68% (-0.01% 🔻)
3232/3686
🟡 Branches
69% (+0.01% 🔼)
2219/3216
🟢 Functions
83.38% (-0.07% 🔻)
597/716
🟢 Lines
88.22% (+0% 🔼)
2989/3388
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / taipyReducers.ts
91.42% (-0.3% 🔻)
83.25% (-0.35% 🔻)
88.46% (-1.33% 🔻)
91.87% (-0.11% 🔻)

Test suite run success

647 tests passing in 43 suites.

Report generated by 🧪jest coverage report action from dde38b9

FabienLelaquais
FabienLelaquais previously approved these changes Oct 2, 2024
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@dinhlongviolin1 dinhlongviolin1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good changes

Copy link
Contributor

github-actions bot commented Oct 2, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
18912 16381 87% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
taipy/gui/gui.py 79% 🟢
taipy/gui/types.py 94% 🟢
TOTAL 87% 🟢

updated for commit: a67c95d by action🐍

@FredLL-Avaiga FredLL-Avaiga merged commit 6e9ed22 into develop Oct 2, 2024
129 checks passed
@FredLL-Avaiga FredLL-Avaiga deleted the bug/#1608-stack-broadcast branch October 2, 2024 14:56
jrobinAV pushed a commit that referenced this pull request Oct 3, 2024
* Stack broadcasts so that not one is lost
resolves #1608

* fix test and typo

* test

---------

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Related to Taipy Core GUI: Front-End 💥Malfunction Addresses an identified problem. 🟥 Priority: Critical Must be addressed as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛 BUG] Submit button unactive after data node lock
3 participants