Declaration
A declaration is a lightweight way to describe a value or object that should participate in provenance without forcing the SDK to infer everything automatically from the raw Python value.
You should care about declarations when you need to be explicit about how a function input or output is represented in the graph. They are useful in advanced compute workflows where a plain Python value is not descriptive enough on its own, or where you want to control the asset metadata and identity associated with that value.
Most users will rely on assets and @compute directly, but declarations become useful when you are shaping more customized lineage behavior around function boundaries.
add_attachment_cid
add_attachment_cid(cid: str) -> Declaration
Appends the CID to the attachment cid list of the declaration.
add_control_cid
add_control_cid(cid: str) -> Declaration
Appends the CID to the control cid list of the declaration.
add_extra
add_extra(key: str, val: str) -> Declaration
Adds or Overwrites the key/value in the extra field of the declaration.
to_dict
to_dict() -> Dict[str, Any]
Convert to dictionary, omitting empty/None values.
to_json
to_json() -> str
Convert to JSON string.