From 63c6dada100ed1d2fea916bc5ef72615bd563ad0 Mon Sep 17 00:00:00 2001 From: Doug Beatty Date: Thu, 25 Apr 2024 17:41:06 -0600 Subject: [PATCH] Fix exception when `version` is missing when installing from the Hub package --- .changes/unreleased/Fixes-20240425-174024.yaml | 7 +++++++ core/dbt/contracts/project.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20240425-174024.yaml diff --git a/.changes/unreleased/Fixes-20240425-174024.yaml b/.changes/unreleased/Fixes-20240425-174024.yaml new file mode 100644 index 00000000000..e1dd734a68a --- /dev/null +++ b/.changes/unreleased/Fixes-20240425-174024.yaml @@ -0,0 +1,7 @@ +kind: Fixes +body: Fix exception when `version` is missing when installing from the Hub package + index +time: 2024-04-25T17:40:24.465839-06:00 +custom: + Author: dbeatty10 + Issue: "10048" diff --git a/core/dbt/contracts/project.py b/core/dbt/contracts/project.py index 0fa0a2fabfe..2f84ad1cb33 100644 --- a/core/dbt/contracts/project.py +++ b/core/dbt/contracts/project.py @@ -116,7 +116,7 @@ def validate(cls, data): "A git package is missing the value. It is a required property." ) if isinstance(package, dict) and package.get("package"): - if not package["version"]: + if not package.get("version"): raise ValidationError( f"{package['package']} is missing the version. When installing from the Hub " "package index, version is a required property"