|
1 | 1 | import json |
2 | 2 | import re |
3 | | - |
4 | | -from skyflow.generated.rest import RedactionEnumREDACTION |
5 | 3 | from skyflow.service_account import is_expired |
6 | | -from skyflow.utils.enums import LogLevel, TokenStrict, Redaction, Env |
| 4 | +from skyflow.utils.enums import LogLevel, TokenStrict, Env, RedactionType |
7 | 5 | from skyflow.error import SkyflowError |
8 | 6 | from skyflow.utils import SkyflowMessages |
9 | 7 | from skyflow.utils.logger import log_info, log_error_log |
@@ -391,7 +389,7 @@ def validate_get_request(logger, request): |
391 | 389 | if not isinstance(request.return_tokens, bool): |
392 | 390 | raise SkyflowError(SkyflowMessages.Error.INVALID_RETURN_TOKENS_TYPE.value, invalid_input_error_code) |
393 | 391 |
|
394 | | - if redaction_type is not None and not isinstance(redaction_type, RedactionEnumREDACTION): |
| 392 | + if redaction_type is not None and not isinstance(redaction_type, RedactionType): |
395 | 393 | raise SkyflowError(SkyflowMessages.Error.INVALID_REDACTION_TYPE.value.format(type(redaction_type)), invalid_input_error_code) |
396 | 394 |
|
397 | 395 | if fields is not None and (not isinstance(fields, list) or not fields): |
@@ -505,7 +503,7 @@ def validate_update_request(logger, request): |
505 | 503 | raise SkyflowError(SkyflowMessages.Error.IDS_KEY_ERROR.value, invalid_input_error_code) |
506 | 504 |
|
507 | 505 | def validate_detokenize_request(logger, request): |
508 | | - if not isinstance(request.redaction_type, RedactionEnumREDACTION): |
| 506 | + if not isinstance(request.redaction_type, RedactionType): |
509 | 507 | raise SkyflowError(SkyflowMessages.Error.INVALID_REDACTION_TYPE.value.format(type(request.redaction_type)), invalid_input_error_code) |
510 | 508 |
|
511 | 509 | if not isinstance(request.continue_on_error, bool): |
|
0 commit comments