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

inner function #2494

Merged
merged 7 commits into from
Mar 13, 2025
Merged

inner function #2494

merged 7 commits into from
Mar 13, 2025

Conversation

FredLL-Avaiga
Copy link
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Handle inner functions as lambdas

Related Tickets & Documents

How to reproduce the issue

import taipy.gui.builder as tgb
from taipy import Gui


def print_something_root(state):
    state.out_str = f"root: {state.in_str}"


in_str = "things!"
out_str = ""


def create_x(name: str):
    def print_something(state):
        state.out_str = f"{name} {state.in_str}"

    tgb.input("{in_str}")
    tgb.button("Printer of something", on_action=print_something)
    tgb.button("Printer of something with Lambda", on_action=lambda state: print_something(state))
    tgb.button("Printer of something from root", on_action=print_something_root)
    tgb.text("{out_str}")


with tgb.Page() as root:
    create_x(name="Awsome")

if __name__ == "__main__":
    Gui(page=root).run(title="2287 Inner Function")

Fred Lefévère-Laoide added 4 commits March 11, 2025 16:50
@FredLL-Avaiga FredLL-Avaiga added 🟥 Priority: Critical Must be addressed as soon as possible 💥Malfunction Addresses an identified problem. 📝Release Notes Impacts the Release Notes or the Documentation in general Gui: Back-End labels Mar 13, 2025
@FredLL-Avaiga FredLL-Avaiga self-assigned this Mar 13, 2025
Copy link
Contributor

github-actions bot commented Mar 13, 2025

Coverage report for ./frontend/taipy

Caution

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

St.
Category Percentage Covered / Total
🔴 Statements 51.87% 263/507
🔴 Branches 21.61% 67/310
🔴 Functions 14.66% 17/116
🔴 Lines 53.19% 242/455

Test suite run success

7 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from 03d068b

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.

LGTM

@FredLL-Avaiga FredLL-Avaiga merged commit 5c56f12 into develop Mar 13, 2025
126 checks passed
@FredLL-Avaiga FredLL-Avaiga deleted the bug/#2287-inner-function branch March 13, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gui: Back-End 💥Malfunction Addresses an identified problem. 🟥 Priority: Critical Must be addressed as soon as possible 📝Release Notes Impacts the Release Notes or the Documentation in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor] Address warnings / errors for locally created methods
3 participants