瀏覽代碼

fix: update the refman for export()

trgiangdo 1 年之前
父節點
當前提交
af07836456
共有 2 個文件被更改,包括 8 次插入1 次删除
  1. 4 0
      taipy/core/scenario/scenario.py
  2. 4 1
      taipy/core/taipy.py

+ 4 - 0
taipy/core/scenario/scenario.py

@@ -592,11 +592,15 @@ class Scenario(_Entity, Submittable, _Labeled):
 
 
         Parameters:
         Parameters:
             folder_path (Union[str, pathlib.Path]): The folder path to export the scenario to.
             folder_path (Union[str, pathlib.Path]): The folder path to export the scenario to.
+                If the path exists and the override parameter is False, an exception is raised.
             override (bool): If True, the existing folder will be overridden. Default is False.
             override (bool): If True, the existing folder will be overridden. Default is False.
             include_data (bool): If True, the file-based data nodes are exported as well.
             include_data (bool): If True, the file-based data nodes are exported as well.
                 This includes Pickle, CSV, Excel, Parquet, and JSON data nodes.
                 This includes Pickle, CSV, Excel, Parquet, and JSON data nodes.
                 If the scenario has a data node that is not file-based, a warning will be logged, and the data node
                 If the scenario has a data node that is not file-based, a warning will be logged, and the data node
                 will not be exported. The default value is False.
                 will not be exported. The default value is False.
+
+        Raises:
+            ExportFolderAlreadyExist^: If the `folder_path` already exists and the override parameter is False.
         """
         """
         from ... import core as tp
         from ... import core as tp
 
 

+ 4 - 1
taipy/core/taipy.py

@@ -955,13 +955,16 @@ def export_scenario(
     Parameters:
     Parameters:
         scenario_id (ScenarioId): The ID of the scenario to export.
         scenario_id (ScenarioId): The ID of the scenario to export.
         folder_path (Union[str, pathlib.Path]): The folder path to export the scenario to.
         folder_path (Union[str, pathlib.Path]): The folder path to export the scenario to.
+            If the path exists and the override parameter is False, an exception is raised.
         override (bool): If True, the existing folder will be overridden. Default is False.
         override (bool): If True, the existing folder will be overridden. Default is False.
         include_data (bool): If True, the file-based data nodes are exported as well.
         include_data (bool): If True, the file-based data nodes are exported as well.
             This includes Pickle, CSV, Excel, Parquet, and JSON data nodes.
             This includes Pickle, CSV, Excel, Parquet, and JSON data nodes.
             If the scenario has a data node that is not file-based, a warning will be logged, and the data node
             If the scenario has a data node that is not file-based, a warning will be logged, and the data node
             will not be exported. The default value is False.
             will not be exported. The default value is False.
-    """
 
 
+    Raises:
+        ExportFolderAlreadyExist^: If the `folder_path` already exists and the override parameter is False.
+    """
     manager = _ScenarioManagerFactory._build_manager()
     manager = _ScenarioManagerFactory._build_manager()
     scenario = manager._get(scenario_id)
     scenario = manager._get(scenario_id)
     entity_ids = manager._get_children_entity_ids(scenario)
     entity_ids = manager._get_children_entity_ids(scenario)