From 8e027d8fcfbf3958cbc97dfe38fba153d1077a6d Mon Sep 17 00:00:00 2001 From: pei Date: Wed, 20 Nov 2024 10:31:44 +0900 Subject: [PATCH] Handle non-English Snowflake error message for non-existing schemas (#840) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Handle Japanese Snowflake error message for non-existing schemas * impl.py を更新 Co-authored-by: Anders * Changelog entry * Update dbt/adapters/snowflake/impl.py Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --------- Co-authored-by: Anders Co-authored-by: Doug Beatty Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Co-authored-by: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com> Co-authored-by: Mike Alfare <13974384+mikealfare@users.noreply.github.com> --- .changes/unreleased/Fixes-20231129-124145.yaml | 6 ++++++ dbt/adapters/snowflake/impl.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20231129-124145.yaml diff --git a/.changes/unreleased/Fixes-20231129-124145.yaml b/.changes/unreleased/Fixes-20231129-124145.yaml new file mode 100644 index 000000000..72a889d17 --- /dev/null +++ b/.changes/unreleased/Fixes-20231129-124145.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Handle non-English Snowflake error message for non-existing schemas +time: 2023-11-29T12:41:45.1273-07:00 +custom: + Author: pei0804 + Issue: "834" diff --git a/dbt/adapters/snowflake/impl.py b/dbt/adapters/snowflake/impl.py index dc256c1cb..ac0d903db 100644 --- a/dbt/adapters/snowflake/impl.py +++ b/dbt/adapters/snowflake/impl.py @@ -257,7 +257,9 @@ def list_relations_without_caching( # if the schema doesn't exist, we just want to return. # Alternatively, we could query the list of schemas before we start # and skip listing the missing ones, which sounds expensive. - if "Object does not exist" in str(exc): + # "002043 (02000)" is error code for "object does not exist or is not found" + # The error message text may vary across languages, but the error code is expected to be more stable + if "002043 (02000)" in str(exc): return [] raise