From b6728f4e6727bd12f34c3bbbbb695dd284fe15af Mon Sep 17 00:00:00 2001 From: trgiangdo Date: Mon, 22 Jul 2024 15:39:02 +0700 Subject: [PATCH 1/2] doc: add document for filtering scenarios with creation_time --- docs/manuals/userman/sdm/scenario/index.md | 13 +++++++++---- docs/release-notes/index.md | 7 +++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/manuals/userman/sdm/scenario/index.md b/docs/manuals/userman/sdm/scenario/index.md index a86da1b25..f74fcde30 100644 --- a/docs/manuals/userman/sdm/scenario/index.md +++ b/docs/manuals/userman/sdm/scenario/index.md @@ -272,8 +272,9 @@ from the config_id provided as a parameter. ## Get all scenarios -All the scenarios can be retrieved using the method `taipy.get_scenarios()^`. This method -returns the list of all existing scenarios. Here is the list of the parameters: +All the scenarios can be retrieved using the method `taipy.get_scenarios()^`. This method returns +the list of all existing scenarios. To filter and sort the list of scenarios, you can use the +following parameters: - *cycle* represents the optional `Cycle^` to filter scenarios by. If provided, the list contains all the existing scenarios of the cycle. @@ -288,6 +289,8 @@ returns the list of all existing scenarios. Here is the list of the parameters: order for dates, in alphabetical order for name and id, and in lexicographical order for tags. The default value is "name". If an incorrect sorting key is provided, the scenarios are sorted by name. +- *created_start_time* represents the optional inclusive start date to filter scenarios by creation date. +- *created_end_time* represents the optional inclusive end date to filter scenarios by creation date. !!! note @@ -305,8 +308,8 @@ lists of corresponding scenarios as values. The `taipy.get_primary()^` method returns the primary scenario of the cycle given as a parameter. -The `taipy.get_primary_scenarios()^` method returns the primary scenarios for all the -existing cycles. The list of primary scenarios can be sorted using the parameters: +The `taipy.get_primary_scenarios()^` method returns the primary scenarios for all the existing +cycles. The list of primary scenarios can be sorted and filtered using the following parameters: - *is_sorted* represents if the output list of scenarios is sorted using the sorting key. The default value is False. @@ -317,6 +320,8 @@ existing cycles. The list of primary scenarios can be sorted using the parameter order for dates, in alphabetical order for name and id, and in lexicographical order for tags. The default value is "name". If an incorrect sorting key is provided, the scenarios are sorted by name. +- *created_start_time* represents the optional inclusive start date to filter scenarios by creation date. +- *created_end_time* represents the optional inclusive end date to filter scenarios by creation date. # Promote a scenario as primary diff --git a/docs/release-notes/index.md b/docs/release-notes/index.md index 03edefa5a..8184ed052 100644 --- a/docs/release-notes/index.md +++ b/docs/release-notes/index.md @@ -37,8 +37,11 @@ This is the list of changes to Taipy releases as they were published.

taipy-core 3.2.0

-- The `taipy.get_scenarios()` and `taipy.get_primary_scenarios()^` methods now accept optional parameters to - sort the output list of scenarios by name, id, creation date, or tag. For more information, please refer to +- The `taipy.get_scenarios()` and `taipy.get_primary_scenarios()^` methods now accept optional parameters to: + + - sort the output list of scenarios by name, id, creation date, or tag + - filter the output list of scenarios that are created in a specific time range.
+ For more information, please refer to [Get all scenarios](../manuals/userman/sdm/scenario/index.md#get-all-scenarios) and [Get primary scenarios](../manuals/userman/sdm/scenario/index.md#get-primary-scenarios). From cf710956c52a86de63004a5bc1cce939a5f7cf6d Mon Sep 17 00:00:00 2001 From: trgiangdo Date: Mon, 22 Jul 2024 22:32:30 +0700 Subject: [PATCH 2/2] fix: filter scenarios with creation_time should exclude the created_end_time --- docs/manuals/userman/sdm/scenario/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/manuals/userman/sdm/scenario/index.md b/docs/manuals/userman/sdm/scenario/index.md index f74fcde30..90dfbcfed 100644 --- a/docs/manuals/userman/sdm/scenario/index.md +++ b/docs/manuals/userman/sdm/scenario/index.md @@ -290,7 +290,7 @@ following parameters: The default value is "name". If an incorrect sorting key is provided, the scenarios are sorted by name. - *created_start_time* represents the optional inclusive start date to filter scenarios by creation date. -- *created_end_time* represents the optional inclusive end date to filter scenarios by creation date. +- *created_end_time* represents the optional exclusive end date to filter scenarios by creation date. !!! note @@ -321,7 +321,7 @@ cycles. The list of primary scenarios can be sorted and filtered using the follo The default value is "name". If an incorrect sorting key is provided, the scenarios are sorted by name. - *created_start_time* represents the optional inclusive start date to filter scenarios by creation date. -- *created_end_time* represents the optional inclusive end date to filter scenarios by creation date. +- *created_end_time* represents the optional exclusive end date to filter scenarios by creation date. # Promote a scenario as primary