Skip to content

Commit

Permalink
Make the https:// optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed May 4, 2021
1 parent 27409c4 commit 3a41bf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
### Under the hood

- Parse information returned by `list_relations_without_caching` macro to speed up catalog generation ([#93](https://github.com/fishtown-analytics/dbt-spark/issues/93), [#160](https://github.com/fishtown-analytics/dbt-spark/pull/160))
- More flexible host passing, https:// can be omitted ([#153](https://github.com/fishtown-analytics/dbt-spark/issues/153))

### Contributors
- [@friendofasquid](https://github.com/friendofasquid) ([#159](https://github.com/fishtown-analytics/dbt-spark/pull/159))
- [@franloza](https://github.com/franloza) ([#160](https://github.com/fishtown-analytics/dbt-spark/pull/160))

- [@Fokko](https://github.com/Fokko) ([#165](https://github.com/fishtown-analytics/dbt-spark/pull/165))

## dbt-spark 0.19.1 (Release TBD)

Expand Down
4 changes: 2 additions & 2 deletions dbt/adapters/spark/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class SparkConnectionManager(SQLConnectionManager):
SPARK_CLUSTER_HTTP_PATH = "/sql/protocolv1/o/{organization}/{cluster}"
SPARK_SQL_ENDPOINT_HTTP_PATH = "/sql/1.0/endpoints/{endpoint}"
SPARK_CONNECTION_URL = (
"https://{host}:{port}" + SPARK_CLUSTER_HTTP_PATH
"{host}:{port}" + SPARK_CLUSTER_HTTP_PATH
)

@contextmanager
Expand Down Expand Up @@ -321,7 +321,7 @@ def open(cls, connection):
'cluster', 'organization'])

conn_url = cls.SPARK_CONNECTION_URL.format(
host=creds.host,
host=creds.host if creds.host.startswith('https://') else 'https://' + creds.host,
port=creds.port,
organization=creds.organization,
cluster=creds.cluster
Expand Down

0 comments on commit 3a41bf6

Please sign in to comment.