prefect.utilities.callables
get_call_parameters
__prefect_self__
attribute, it will be included as
the first parameter. This attribute is set when Prefect decorates a bound
method, so this approach allows Prefect to work with bound methods in a way
that is consistent with how Python handles them (i.e. users don’t have to
pass the instance argument to the method) while still making the implicit self
argument visible to all of Prefect’s parameter machinery (such as cache key
functions).
Raises a ParameterBindError if the arguments/kwargs are not valid for the
function
get_parameter_defaults
explode_variadic_parameter
collapse_variadic_parameters
parameters_to_args_kwargs
parameters
dictionary to positional and keyword arguments
The function must have an identical signature to the original function or this
will return an empty tuple and dict.
call_with_parameters
get_call_parameters
The function must have an identical signature to the original function or this
will fail. If you need to send to a function with a different signature, extract
the args/kwargs using parameters_to_positional_and_keyword
directly
cloudpickle_wrapped_call
anyio.to_process
and multiprocessing
) but may require
a wider range of pickling support.
parameter_docstrings
docstring
: The function’s docstring.process_v1_params
create_v1_schema
parameter_schema
fn
: The function whose arguments will be serializedparameter_schema_from_entrypoint
entrypoint
: A string representing the entrypoint to a function. The string
should be in the format of module.path.to.function\:do_stuff
.generate_parameter_schema
inspect.signature(fn)
or
_generate_signature_from_source(source_code, func_name)
.
Args:
signature
: The function signature.docstrings
: A dictionary mapping parameter names to docstrings.raise_for_reserved_arguments
fn
has any parameters that conflict
with the names contained in reserved_arguments
.
expand_mapping_parameters
func
: The function to be calledparameters
: A dictionary of parameters with iterables to be mapped overParameterSchema
Schema
.
Methods:
model_dump_for_openapi