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

filter with non identifier property names #1551

Merged
merged 12 commits into from
Jul 18, 2024

Conversation

FredLL-Avaiga
Copy link
Member

@FredLL-Avaiga FredLL-Avaiga commented Jul 18, 2024

resolves #1545

deal with values other than string

# Import necessary libraries
import datetime as dt

import taipy as tp
from taipy import Config, Frequency


# 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=data,
)


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)


filter_for_scenario = [
    "Config id",
    "Label",
    "Creation date",
    "Cycle label",
    "Cycle start",
    "Cycle end",
    "Primary",
    "Tags",
    "Number_of_Warehouses",
    "Fix_warehouses",
    "Fixed warehouses",
    "Fixed_warehouses",
    "date_wh"
]

# GUI Markdown content
scenario_md = """
<|{scenario}|scenario_selector|filter={filter_for_scenario}|>

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


def add_properties(scenario):
    scenario.properties["Fix_warehouses"] = True
    scenario.properties["Number_of_Warehouses"] = 5
    scenario.properties["Fixed_warehouses"] = ["Louisville"]
    scenario.properties["Fixed warehouses"] = ["Louisville"]
    scenario.properties["date_wh"] = dt.datetime.now()
    return scenario

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

    tp.Gui(scenario_md).run(title="1545 Sort by Scenario properties")

@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: Back-End labels Jul 18, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Jul 18, 2024
Copy link
Contributor

github-actions bot commented Jul 18, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
19375 16403 85% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
taipy/core/config/data_node_config.py 99% 🟢
taipy/gui/gui.py 81% 🟢
taipy/gui_core/_adapters.py 50% 🟢
TOTAL 76% 🟢

updated for commit: d7c4bc9 by action🐍

compare str in lowercase
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.

🫤

taipy/gui_core/_adapters.py Outdated Show resolved Hide resolved
taipy/gui_core/_adapters.py Show resolved Hide resolved
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

namnguyen20999
namnguyen20999 previously approved these changes Jul 18, 2024
Copy link
Member

@namnguyen20999 namnguyen20999 left a comment

Choose a reason for hiding this comment

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

LGTM

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

@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.

👍

@FredLL-Avaiga FredLL-Avaiga merged commit f987f22 into develop Jul 18, 2024
156 of 158 checks passed
@FredLL-Avaiga FredLL-Avaiga deleted the bug/#1545-non-identifier-property-name branch July 18, 2024 20:09
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: Back-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] Filter on scenario properties in Scenario Selector not working
4 participants