Skip to content

Commit

Permalink
Ignore trailing / in host name
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tim-steinkuhler committed Jun 23, 2023
1 parent a1d161c commit 6d01241
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dbt/adapters/spark/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6d01241

Please sign in to comment.