docs/integrations/prefect-aws/api-ref/prefect_aws-utilities.mdx
prefect_aws.utilitiesUtilities for working with AWS services.
hash_collection <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/utilities.py#L8" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>hash_collection(collection) -> int
Use visit_collection to transform and hash a collection.
Args:
collection: The collection to hash.Returns:
ensure_path_exists <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/utilities.py#L40" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>ensure_path_exists(doc: Union[Dict, List], path: List[str])
Ensures the path exists in the document, creating empty dictionaries or lists as needed.
Args:
doc: The current level of the document or sub-document.path: The remaining path parts to ensure exist.assemble_document_for_patches <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/utilities.py#L73" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>assemble_document_for_patches(patches)
Assembles an initial document that can successfully accept the given JSON Patch operations.
Args:
patches: A list of JSON Patch operations.Returns:
Example:
patches = [
{"op": "replace", "path": "/name", "value": "Jane"},
{"op": "add", "path": "/contact/address", "value": "123 Main St"},
{"op": "remove", "path": "/age"}
]
initial_document = assemble_document_for_patches(patches)
#output
{
"name": {},
"contact": {},
"age": {}
}