Browse Source

fixed doc

Toan Quach 1 year ago
parent
commit
1ff10a0a0e
2 changed files with 7 additions and 5 deletions
  1. 1 1
      taipy/core/common/_check_entity_and_get_manager.py
  2. 6 4
      taipy/core/taipy.py

+ 1 - 1
taipy/core/common/_check_entity_and_get_manager.py

@@ -1,4 +1,4 @@
-# Copyright 2023 Avaiga Private Limited
+# Copyright 2021-2024 Avaiga Private Limited
 #
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 # the License. You may obtain a copy of the License at
 # the License. You may obtain a copy of the License at

+ 6 - 4
taipy/core/taipy.py

@@ -95,7 +95,7 @@ def is_editable(
         ScenarioId,
         ScenarioId,
         CycleId,
         CycleId,
         SubmissionId,
         SubmissionId,
-    ]
+    ],
 ) -> bool:
 ) -> bool:
     """Indicate if an entity can be edited.
     """Indicate if an entity can be edited.
 
 
@@ -125,7 +125,7 @@ def is_readable(
         ScenarioId,
         ScenarioId,
         CycleId,
         CycleId,
         SubmissionId,
         SubmissionId,
-    ]
+    ],
 ) -> bool:
 ) -> bool:
     """Indicate if an entity can be read.
     """Indicate if an entity can be read.
 
 
@@ -145,7 +145,7 @@ def submit(
     force: bool = False,
     force: bool = False,
     wait: bool = False,
     wait: bool = False,
     timeout: Optional[Union[float, int]] = None,
     timeout: Optional[Union[float, int]] = None,
-) -> Union[Job, List[Job]]:
+) -> Optional[Union[Job, List[Job]]]:
     """Submit a scenario, sequence or task entity for execution.
     """Submit a scenario, sequence or task entity for execution.
 
 
     This function submits the given entity for execution and returns the created job(s).
     This function submits the given entity for execution and returns the created job(s).
@@ -169,6 +169,7 @@ def submit(
     """
     """
     if manager := _check_entity_and_get_manager(entity, [Scenario, Sequence, Task]):
     if manager := _check_entity_and_get_manager(entity, [Scenario, Sequence, Task]):
         return manager._submit(entity, force=force, wait=wait, timeout=timeout)  # type: ignore
         return manager._submit(entity, force=force, wait=wait, timeout=timeout)  # type: ignore
+    return None
 
 
 
 
 @overload
 @overload
@@ -283,7 +284,7 @@ def get(entity_id: str) -> Union[Task, DataNode, Sequence, Scenario, Job, Cycle,
 
 
 
 
 def get(
 def get(
-    entity_id: Union[TaskId, DataNodeId, SequenceId, ScenarioId, JobId, CycleId, SubmissionId, str]
+    entity_id: Union[TaskId, DataNodeId, SequenceId, ScenarioId, JobId, CycleId, SubmissionId, str],
 ) -> Union[Task, DataNode, Sequence, Scenario, Job, Cycle, Submission]:
 ) -> Union[Task, DataNode, Sequence, Scenario, Job, Cycle, Submission]:
     """Retrieve an entity by its unique identifier.
     """Retrieve an entity by its unique identifier.
 
 
@@ -354,6 +355,7 @@ def delete(entity_id: Union[TaskId, DataNodeId, SequenceId, ScenarioId, JobId, C
       the scenario can be deleted.
       the scenario can be deleted.
     - If a `SequenceId` is provided, the related jobs are deleted.
     - If a `SequenceId` is provided, the related jobs are deleted.
     - If a `TaskId` is provided, the related data nodes, and jobs are deleted.
     - If a `TaskId` is provided, the related data nodes, and jobs are deleted.
+    - If a `DataNodeId` is provided, the data node is deleted.
     - If a `SubmissionId^` or a `JobId^` is provided, the submission or job entity can only be deleted if
     - If a `SubmissionId^` or a `JobId^` is provided, the submission or job entity can only be deleted if
       the execution has been finished.
       the execution has been finished.