From 6d012412ec35befaff039307b2fcd1c859ab2284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Steink=C3=BChler?= Date: Sun, 21 May 2023 20:19:44 +0000 Subject: [PATCH 1/2] Ignore trailing / in host name The trailing / is often added automatically when copy pasting Before this change, you would get "Database Error - failed to connect" After this change, the trailing backslash won't prevent your connection --- dbt/adapters/spark/connections.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbt/adapters/spark/connections.py b/dbt/adapters/spark/connections.py index 9d3e385b0..514ec5ccb 100644 --- a/dbt/adapters/spark/connections.py +++ b/dbt/adapters/spark/connections.py @@ -140,6 +140,9 @@ def __post_init__(self): f"ImportError({e.msg})" ) from e + if self.method != SparkConnectionMethod.SESSION: + self.host = self.host.rstrip("/") + @property def type(self): return "spark" From 7aa24601e8b8a884a36332040b4ac9f0e22eb661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Steink=C3=BChler?= Date: Sun, 21 May 2023 20:37:43 +0000 Subject: [PATCH 2/2] Update changelog --- .changes/unreleased/Fixes-20230623-112100.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Fixes-20230623-112100.yaml diff --git a/.changes/unreleased/Fixes-20230623-112100.yaml b/.changes/unreleased/Fixes-20230623-112100.yaml new file mode 100644 index 000000000..d6129c908 --- /dev/null +++ b/.changes/unreleased/Fixes-20230623-112100.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Allow hostname to be provided with or without trailing slash +time: 2023-06-23T11:21:00.901430172Z +custom: + Author: tim-steinkuhler + Issue: "302"