community[patch]: Remove more @allow_reuse=True validators (#25236)

Remove some additional allow_reuse=True usage in @root_validators.
pull/25242/head
Eugene Yurtsev 1 month ago committed by GitHub
parent 6e57aa7c36
commit bd6c31617e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -387,7 +387,7 @@ class MiniMaxChat(BaseChatModel):
class Config:
allow_population_by_field_name = True
@root_validator(pre=True, allow_reuse=True)
@root_validator(pre=True)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that api key and python package exists in environment."""
values["minimax_api_key"] = convert_to_secret_str(

@ -21,7 +21,7 @@ class BaseGitHubLoader(BaseLoader, BaseModel, ABC):
github_api_url: str = "https://api.github.com"
"""URL of GitHub API"""
@root_validator(pre=True, allow_reuse=True)
@root_validator(pre=True)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that access token exists in environment."""
values["access_token"] = get_from_dict_or_env(

@ -56,7 +56,7 @@ class ClovaEmbeddings(BaseModel, Embeddings):
class Config:
extra = "forbid"
@root_validator(pre=True, allow_reuse=True)
@root_validator(pre=True)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate api key exists in environment."""
values["clova_emb_api_key"] = convert_to_secret_str(

@ -31,7 +31,7 @@ class _MinimaxEndpointClient(BaseModel):
api_key: SecretStr
api_url: str
@root_validator(pre=True, allow_reuse=True)
@root_validator(pre=True)
def set_api_url(cls, values: Dict[str, Any]) -> Dict[str, Any]:
if "api_url" not in values:
host = values["host"]

@ -48,7 +48,7 @@ class PowerBIDataset(BaseModel):
"""Fix the table names."""
return [fix_table_name(table) for table in table_names]
@root_validator(pre=True, allow_reuse=True)
@root_validator(pre=True)
def token_or_credential_present(cls, values: Dict[str, Any]) -> Dict[str, Any]:
"""Validate that at least one of token and credentials is present."""
if "token" in values or "credential" in values:

Loading…
Cancel
Save