nat.experimental.decorators.experimental_warning_decorator#

Attributes#

Functions#

issue_experimental_warning(function_name[, ...])

Log a warning message that the function is experimental.

experimental(…)

Decorator that can wrap any type of function (sync, async, generator,

Module Contents#

logger#
BASE_WARNING_MESSAGE = 'is experimental and the API may change in future releases. Future versions may introduce...#
_warning_issued#
F#
issue_experimental_warning(
function_name: str,
feature_name: str | None = None,
metadata: dict[str, Any] | None = None,
)#

Log a warning message that the function is experimental.

A warning is emitted only once per function. When a metadata dict is supplied, it is appended to the log entry to provide extra context (e.g., version, author, feature flag).

experimental(
func: F,
*,
feature_name: str | None = None,
metadata: dict[str, Any] | None = None,
) F#
experimental(
*,
feature_name: str | None = None,
metadata: dict[str, Any] | None = None,
) collections.abc.Callable[[F], F]

Decorator that can wrap any type of function (sync, async, generator, async generator) and logs a warning that the function is experimental.

Args:

func: The function to be decorated. feature_name: Optional name of the feature that is experimental. If provided, the warning will be prefixed with “The <feature_name> feature is experimental”. metadata: Optional dictionary of metadata to log with the warning. This can include information like version, author, etc. If provided, the metadata will be logged alongside the experimental warning.

aiq_experimental#