yaml_workflow.tasks.batch_context¶
yaml_workflow.tasks.batch_context
¶
Batch processing context management.
Classes¶
BatchContext
¶
Context manager for batch processing with namespace support.
Source code in src/yaml_workflow/tasks/batch_context.py
Functions¶
create_item_context(item: Any, index: int) -> Dict[str, Any]
¶
Create context for a batch item while preserving namespaces.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item
|
Any
|
The batch item being processed |
required |
index
|
int
|
Index of the item in the batch |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict containing the item context with namespace support |
Source code in src/yaml_workflow/tasks/batch_context.py
get_available_variables() -> Dict[str, List[str]]
¶
Get available variables by namespace.
Returns:
Type | Description |
---|---|
Dict[str, List[str]]
|
Dict mapping namespace names to lists of available variables |
Source code in src/yaml_workflow/tasks/batch_context.py
get_error_context(error: Exception) -> Dict[str, Any]
¶
Get error context with namespace information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
error
|
Exception
|
The exception that occurred |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict containing error context with namespace information |