perago.perago_metadata#
- perago.perago_metadata(*, task, workspace, workspace_spec, logical_task_key, phase, extra=None)[源代码]#
Build the Perago metadata map for one workspace transaction phase.
- Parameters:
- taskobject
Attempt-like object exposing the workflow identity, task identity, and retry attributes recorded in Perago metadata.
- workspaceWorkspaceInput | dict[str, Any]
Workspace input reference for the attempt. Dictionaries are validated through
perago.WorkspaceInput.- workspace_specWorkspaceSpec
Workspace contract whose normalized prefix is recorded in metadata.
- logical_task_keystr
Stable logical task identity, typically from
perago.logical_task_key().- phasestr
Transaction phase marker such as
"try"or"confirm".- extradict[str, object] | None, optional
Additional metadata values merged into the standard Perago keys before string serialization.
- Returns:
- dict[str, str]
Metadata map with all values converted to LakeFS-compatible strings.
- Raises:
- AttributeError
Raised when
taskis missing required attempt attributes.- pydantic.ValidationError
Raised when
workspacecannot be validated asperago.WorkspaceInput.- TypeError
Raised when any metadata value is not JSON-serializable.
- 参数:
- 返回类型: