|
16 | 16 |
|
17 | 17 |
|
18 | 18 | def exec(item: Item, args: Namespace) -> str | None: |
19 | | - """Execute the creation of a Microsoft Fabric item. |
20 | | - |
21 | | - Handles two scenarios based on is_root_operation: |
22 | | - - **Root operation** (is_root_operation = True): User-initiated standalone creation. |
23 | | - Shows individual output, handles dependencies, and cleans up batch collection. |
24 | | - - **Batch operation** (is_root_operation = False): Part of dependency creation chain. |
25 | | - Operates silently, collects results for consolidated output by root operation. |
26 | | - |
| 19 | + """ |
| 20 | + Execute the creation of a Microsoft Fabric item. |
| 21 | +
|
| 22 | + This method supports items that may require creating additional dependent |
| 23 | + artifacts (e.g., a Report that implicitly creates a SemanticModel). |
| 24 | + Output behavior differs depending on whether the current call represents the |
| 25 | + user‑requested creation or an internally triggered dependency. |
| 26 | +
|
| 27 | + Two execution modes: |
| 28 | + - **Root operation** (`is_root_operation=True`): |
| 29 | + Represents the item explicitly requested by the user. |
| 30 | + Handles creation of the item and any required dependencies. |
| 31 | + Collects and returns a consolidated output for all created artifacts. |
| 32 | +
|
| 33 | + - **Dependency operation** (`is_root_operation=False`): |
| 34 | + Represents an item created implicitly as part of another item's dependency chain. |
| 35 | + Runs silently and contributes its result to the root operation’s batch output, |
| 36 | + without producing standalone output. |
| 37 | +
|
27 | 38 | Args: |
28 | | - item (Item): The Fabric item to be created |
29 | | - args (Namespace): Command arguments, may contain 'output_batch' for batch operations |
30 | | - |
| 39 | + item (Item): The Fabric item to be created. |
| 40 | + args (Namespace): Command arguments. May include `output_batch` used to |
| 41 | + accumulate results during dependency operations. |
| 42 | +
|
31 | 43 | Returns: |
32 | | - str | None: Created item ID if successful, None if failed |
| 44 | + str | None: The created item ID for root operations, or None for dependency |
| 45 | + operations or failed creations. |
33 | 46 | """ |
34 | 47 | # Determine if this is part of a batch operation |
35 | 48 | is_root_operation = not hasattr(args, 'output_batch') |
|
0 commit comments