mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-28 15:00:23 +00:00
community[patch]: assign missed default (#26326)
Assigning missed defaults in various classes. Most clients were being assigned during the `model_validator(mode="before")` step, so this change should amount to a no-op in those cases. --- This PR was autogenerated using gritql ```shell grit apply 'class_definition(name=$C, $body, superclasses=$S) where { $C <: ! "Config", // Does not work in this scope, but works after class_definition $body <: block($statements), $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where { or { $y <: `Field($z)`, $x <: "model_config" } }, // And has either Any or Optional fields without a default $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where { $t <: or { r"Optional.*", r"Any", r"Union[None, .*]", r"Union[.*, None, .*]", r"Union[.*, None]", }, $y <: ., // Match empty node $t => `$t = None`, }, } ' --language python . ```
This commit is contained in:
@@ -18,7 +18,7 @@ class DataheraldAPIWrapper(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
dataherald_client: Any #: :meta private:
|
||||
dataherald_client: Any = None #: :meta private:
|
||||
db_connection_id: str
|
||||
dataherald_api_key: Optional[str] = None
|
||||
|
||||
|
Reference in New Issue
Block a user