-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add deprecation warning to get_conversation_metadata_by_name
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import warnings | ||
from functools import wraps | ||
|
||
|
||
def deprecated(reason: str, stacklevel: int = 3): | ||
def decorator(func): | ||
@wraps(func) | ||
async def wrapper(*args, **kwargs): | ||
warnings.warn( | ||
f"{func.__name__} is deprecated: {reason}", | ||
DeprecationWarning, | ||
stacklevel=stacklevel, | ||
) | ||
return await func(*args, **kwargs) | ||
|
||
return wrapper | ||
|
||
return decorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters