test_optional_subset_model_rewrite() — langchain Function Reference
Architecture documentation for the test_optional_subset_model_rewrite() function in test_tools.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 9e58d1f8_7c35_df83_a73a_3d97a37f568a["test_optional_subset_model_rewrite()"] 8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"] 9e58d1f8_7c35_df83_a73a_3d97a37f568a -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555 style 9e58d1f8_7c35_df83_a73a_3d97a37f568a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/test_tools.py lines 1014–1022
def test_optional_subset_model_rewrite() -> None:
class MyModel(BaseModel):
a: str | None = None
b: str
c: list[str | None] | None = None
model2 = _create_subset_model("model2", MyModel, ["a", "b", "c"])
assert set(_schema(model2)["required"]) == {"b"}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_optional_subset_model_rewrite() do?
test_optional_subset_model_rewrite() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_tools.py.
Where is test_optional_subset_model_rewrite() defined?
test_optional_subset_model_rewrite() is defined in libs/core/tests/unit_tests/test_tools.py at line 1014.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free