Add new features
This commit is contained in:
parent
2d8e1c1758
commit
2c3f19e67c
1 changed files with 479 additions and 208 deletions
|
|
@ -2,7 +2,11 @@ from functools import wraps
|
|||
from typing import Any, Callable, Dict
|
||||
|
||||
from ..exceptions import ArgumentValidationError
|
||||
from ..helper import get_args, get_function_metadata_store
|
||||
from ..helper import (
|
||||
assert_function_is_not_finalised,
|
||||
get_arguments,
|
||||
get_function_metadata_store,
|
||||
)
|
||||
from ..tracing import TracingContext
|
||||
|
||||
|
||||
|
|
@ -14,12 +18,13 @@ def parameter(
|
|||
) -> Callable[..., Any]:
|
||||
def decorator(func: Callable[..., Any]) -> Callable[..., Any]:
|
||||
get_function_metadata_store(func).input_parameter_names.append(parameter_name)
|
||||
assert_function_is_not_finalised(func)
|
||||
|
||||
actual_name = f"arg:{func.__name__}:{parameter_name}"
|
||||
|
||||
@wraps(func)
|
||||
def wrapper(*args: Any, **kwargs: Dict[str, Any]) -> Any:
|
||||
arguments = get_args(func, args, kwargs)
|
||||
arguments = get_arguments(func, args, kwargs)
|
||||
argument = arguments[parameter_name]
|
||||
|
||||
expected_type = func.__annotations__.get(parameter_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue