community[patch]: Update root_validators to use explicit pre=True or pre=False (#23736)

This commit is contained in:
Eugene Yurtsev
2024-07-01 17:13:23 -04:00
committed by GitHub
parent 5b1de2ae93
commit f24e38876a
7 changed files with 8 additions and 8 deletions

View File

@@ -95,14 +95,14 @@ class SagemakerEndpointCrossEncoder(BaseModel, BaseCrossEncoder):
extra = Extra.forbid
arbitrary_types_allowed = True
@root_validator()
@root_validator(pre=True)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that AWS credentials to and python package exists in environment."""
try:
import boto3
try:
if values["credentials_profile_name"] is not None:
if values.get("credentials_profile_name"):
session = boto3.Session(
profile_name=values["credentials_profile_name"]
)