diff --git a/.changes/unreleased/Fixes-20240714-100254.yaml b/.changes/unreleased/Fixes-20240714-100254.yaml new file mode 100644 index 00000000000..442abc03498 --- /dev/null +++ b/.changes/unreleased/Fixes-20240714-100254.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix typing for artifact schemas +time: 2024-07-14T10:02:54.452099+09:00 +custom: + Author: nakamichiworks + Issue: "10442" diff --git a/core/dbt/artifacts/schemas/base.py b/core/dbt/artifacts/schemas/base.py index c807257a24b..6cca031603e 100644 --- a/core/dbt/artifacts/schemas/base.py +++ b/core/dbt/artifacts/schemas/base.py @@ -77,8 +77,11 @@ def __post_serialize__(self, dct: Dict, context: Optional[Dict] = None): # remote-compile-result # remote-execution-result # remote-run-result +S = TypeVar("S", bound="VersionedSchema") + + def schema_version(name: str, version: int): - def inner(cls: Type[VersionedSchema]): + def inner(cls: Type[S]): cls.dbt_schema_version = SchemaVersion( name=name, version=version,