Skip to content

Commit

Permalink
Add docstring for DSI pydantic shim
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Oct 11, 2024
1 parent e02bb50 commit 38faac7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dsi_pydantic_shim.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
"""Shim to allow support for both Pydantic 1 and Pydantic 2.
DSI must support both major versions of Pydantic because dbt-core depends on DSI. dbt-core users might be using an
environment with either version, and we can't restrict them to one or the other. Here, we essentially import all
Pydantic objects from version 1. Throughout the repo, we import those objects from this file instead of from Pydantic
directly, meaning that we essentially only use Pydantic 1 in this repo, but without forcing that restriction on dbt
users. The development environment for this repo should be pinned to Pydantic 1 to ensure devs get appropriate type
hints.
"""

from importlib.metadata import version

pydantic_version = version("pydantic")
Expand Down

0 comments on commit 38faac7

Please sign in to comment.