Skip to content

Commit

Permalink
Skip resolving for pydantic model fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Aug 28, 2023
1 parent a924e14 commit 99cde31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99cde31

Please sign in to comment.