Skip to content

Commit

Permalink
Deprecation Warning added
Browse files Browse the repository at this point in the history
Signed-off-by: 10sharmashivam <[email protected]>
  • Loading branch information
10sharmashivam committed Oct 30, 2024
1 parent bc0c162 commit 60ae3ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flytekit/core/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import tempfile
import traceback
import typing
import warnings
from contextlib import contextmanager
from contextvars import ContextVar
from dataclasses import dataclass, field
Expand Down Expand Up @@ -359,11 +360,19 @@ def __getattr__(self, item: str) -> _GroupSecrets:

def get(
self,
*,
group: Optional[str] = None,
key: Optional[str] = None,
group_version: Optional[str] = None,
encode_mode: str = "r",
) -> str:
# Raise a warning if this method is called without keyword arguments
if (group is not None and key is not None) and (not isinstance(group, str) or not isinstance(key, str)):
warnings.warn(
"The use of positional arguments for SecretsManager.get is deprecated. "
"Please use keyword arguments instead. This will be removed in a future version.",
DeprecationWarning
)
"""
Retrieves a secret using the resolution order -> Env followed by file. If not found raises a ValueError
param encode_mode, defines the mode to open files, it can either be "r" to read file, or "rb" to read binary file
Expand Down

0 comments on commit 60ae3ba

Please sign in to comment.