From 99cde31b284b57b76d46e9e8ceb7de25a735434c Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Mon, 28 Aug 2023 20:49:46 +0100 Subject: [PATCH] Skip resolving for pydantic model fields --- docs/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/utils.py b/docs/utils.py index 3a20b87fa..2b3cff5dc 100644 --- a/docs/utils.py +++ b/docs/utils.py @@ -94,6 +94,10 @@ def linkcode_resolve(repo_link: str, domain: str, info: dict[str, str]) -> str | pos = _global_assign_pos(source, symbol_name) if pos is None: + if symbol_name in ("model_config", "model_fields"): + # These are ClassVars added by pydantic. + # Since they're not in our source code, we cannot resolve them to a url. + return None raise Exception(f"Could not find symbol `{symbol_name}` in {module.__name__}.") start, end = pos