Move files
This commit is contained in:
parent
3cf28379e8
commit
00cc8225c5
159 changed files with 31 additions and 49 deletions
14
great_ai/helper/assert_function_is_not_finalised.py
Normal file
14
great_ai/helper/assert_function_is_not_finalised.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from typing import Any, Callable
|
||||
|
||||
from ..exceptions import WrongDecoratorOrderError
|
||||
from .get_function_metadata_store import get_function_metadata_store
|
||||
|
||||
|
||||
def assert_function_is_not_finalised(func: Callable[..., Any]) -> None:
|
||||
error_message = (
|
||||
"The outer-most (first) decorator has to be `@GreatAI.deploy`. "
|
||||
+ f"In the case of `{func.__name__}`, it is not: fix this by moving `@GreatAI.deploy` to the top."
|
||||
)
|
||||
|
||||
if get_function_metadata_store(func).is_finalised:
|
||||
raise WrongDecoratorOrderError(error_message)
|
||||
Loading…
Add table
Add a link
Reference in a new issue