mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 06:53:16 +00:00
community[patch]: Add linter to catch @root_validator (#24070)
- Add linter to prevent further usage of vanilla root validator - Udpate remaining root validators
This commit is contained in:
@@ -114,7 +114,7 @@ class YouSearchAPIWrapper(BaseModel):
|
||||
|
||||
return values
|
||||
|
||||
@root_validator
|
||||
@root_validator(pre=False, skip_on_failure=True)
|
||||
def warn_if_set_fields_have_no_effect(cls, values: Dict) -> Dict:
|
||||
if values["endpoint_type"] != "news":
|
||||
news_api_fields = ("search_lang", "ui_lang", "spellcheck")
|
||||
@@ -139,7 +139,7 @@ class YouSearchAPIWrapper(BaseModel):
|
||||
)
|
||||
return values
|
||||
|
||||
@root_validator
|
||||
@root_validator(pre=False, skip_on_failure=True)
|
||||
def warn_if_deprecated_endpoints_are_used(cls, values: Dict) -> Dict:
|
||||
if values["endpoint_type"] == "snippets":
|
||||
warnings.warn(
|
||||
|
Reference in New Issue
Block a user