Skip to content

Commit b6e83c6

Browse files
SK-2522: resolve copilot comments
1 parent 1a5d51d commit b6e83c6

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎skyflow/utils/_skyflow_messages.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Error(Enum):
4848
INVALID_CREDENTIALS_TOKEN_IN_CONFIG = f"{error_prefix} Initialization failed. Invalid credentials token for {{}} with id {{}}. Expected token to be a string."
4949
INVALID_CREDENTIALS_TOKEN = f"{error_prefix} Initialization failed. Invalid credentials token. Expected token to be a string."
5050
EXPIRED_BEARER_TOKEN = f"{error_prefix} Initialization failed. Bearer token is invalid or expired."
51-
EXPIRED_TOKEN = f"${error_prefix} Initialization failed. Given token is expired. Specify a valid credentials token."
51+
EXPIRED_TOKEN = f"{error_prefix} Initialization failed. Given token is expired. Specify a valid credentials token."
5252
EMPTY_API_KEY_IN_CONFIG = f"{error_prefix} Initialization failed. Invalid api key for {{}} with id {{}}.Specify a valid api key."
5353
EMPTY_API_KEY= f"{error_prefix} Initialization failed. Invalid api key.Specify a valid api key."
5454
INVALID_API_KEY_IN_CONFIG = f"{error_prefix} Initialization failed. Invalid api key for {{}} with id {{}}. Expected api key to be a string."
@@ -123,7 +123,7 @@ class Error(Enum):
123123
INVALID_COLUMN_VALUE = f"{error_prefix} Validation error. column_values key has a value of type {{}}. Specify column_values key as list."
124124
INVALID_COLUMN_VALUES = f"{error_prefix} Validation error. column_values key is an empty list. Specify at least one column value when column_name is passed."
125125
INVALID_FIELDS_VALUE = f"{error_prefix} Validation error. fields key has a value of type{{}}. Specify fields key as list."
126-
BOTH_OFFSET_AND_LIMIT_SPECIFIED = f"${error_prefix} Validation error. Both offset and limit cannot be present at the same time"
126+
BOTH_OFFSET_AND_LIMIT_SPECIFIED = f"{error_prefix} Validation error. Both offset and limit cannot be present at the same time"
127127
INVALID_OFF_SET_VALUE = f"{error_prefix} Validation error. offset key has a value of type {{}}. Specify offset key as integer."
128128
INVALID_LIMIT_VALUE = f"{error_prefix} Validation error. limit key has a value of type {{}}. Specify limit key as integer."
129129
INVALID_DOWNLOAD_URL_VALUE = f"{error_prefix} Validation error. download_url key has a value of type {{}}. Specify download_url key as boolean."

‎skyflow/utils/constants.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class DetectStatus:
3535
FAILED = 'FAILED'
3636
UNKNOWN = 'UNKNOWN'
3737

38+
class Detect:
39+
WAIT_TIME = 64
3840

3941
class FileExtension:
4042
JSON = 'json'

‎skyflow/utils/validations/_validations.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from skyflow.utils.constants import (
1010
ApiKey, ResponseField, RequestParameter,
1111
FileUploadField,
12-
DeidentifyFileRequestField, RequestOperation, ConfigType, SqlCommand, ConfigField, OptionField, CredentialField
12+
DeidentifyFileRequestField, RequestOperation, ConfigType, SqlCommand, ConfigField, OptionField, CredentialField, Detect
1313
)
1414
from skyflow.utils.logger import log_info, log_error_log
1515
from skyflow.vault.detect import DeidentifyTextRequest, ReidentifyTextRequest, TokenFormat, Transformations, \
@@ -406,7 +406,7 @@ def validate_deidentify_file_request(logger, request: DeidentifyFileRequest):
406406
if hasattr(request, DeidentifyFileRequestField.WAIT_TIME) and request.wait_time is not None:
407407
if not isinstance(request.wait_time, (int, float)):
408408
raise SkyflowError(SkyflowMessages.Error.INVALID_WAIT_TIME.value, invalid_input_error_code)
409-
if request.wait_time < 0 or request.wait_time > 64:
409+
if request.wait_time < 0 or request.wait_time > Detect.WAIT_TIME:
410410
raise SkyflowError(SkyflowMessages.Error.WAIT_TIME_GREATER_THEN_64.value, invalid_input_error_code)
411411

412412
def validate_insert_request(logger, request):

‎skyflow/vault/controller/_connections.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
parse_invoke_connection_response
66
from skyflow.utils.logger import log_info, log_error_log
77
from skyflow.vault.connection import InvokeConnectionRequest
8-
from skyflow.utils.constants import SKY_META_DATA_HEADER, SKYFLOW
8+
from skyflow.utils.constants import SKY_META_DATA_HEADER, SKYFLOW, HttpHeader
99
from skyflow.utils import get_credentials
1010

1111

0 commit comments

Comments
 (0)