Skip to main content

using_cluster

A decorator that wraps a function to automatically resolve and inject a cluster instance into the function's arguments based on the provided positional arguments.

def using_cluster(
fun: function
) - > function

A decorator that resolves a cluster object from positional arguments before executing the wrapped method.

Parameters

NameTypeDescription
funfunctionThe method to be wrapped, which expects a cluster object as its first argument after 'self'.

Returns

TypeDescription
functionA wrapped version of the function that automatically injects the resolved cluster object as the first positional argument.