From e8def237538c4b4af7ca2bdbd4e04cfaf8d33b48 Mon Sep 17 00:00:00 2001 From: Eric Ford Date: Mon, 1 Nov 2021 11:57:41 -0400 Subject: [PATCH 1/6] Moved from os.path.join to a hard-coded string. Going to pull in a change to building in the url variables. --- dbt/adapters/firebolt/connections.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dbt/adapters/firebolt/connections.py b/dbt/adapters/firebolt/connections.py index 09259a656..6301bfd29 100644 --- a/dbt/adapters/firebolt/connections.py +++ b/dbt/adapters/firebolt/connections.py @@ -99,9 +99,7 @@ def open(cls, connection): return connection def make_jdbc_url(self, credentials): - jdbc_url = os.path.join("jdbc:firebolt://", - credentials.host, - credentials.database) + jdbc_url = f'jdbc:firebolt://{credentials.host}/{credentials.database}' if credentials.params: jdbc_url += "".join( map( From 3f3b8d816f75d51e9a6241ae0081bd2928d0e5a6 Mon Sep 17 00:00:00 2001 From: Eric Ford Date: Mon, 1 Nov 2021 12:50:37 -0400 Subject: [PATCH 2/6] Added account code here, as well, bc I was having issues. --- dbt/adapters/firebolt/connections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/adapters/firebolt/connections.py b/dbt/adapters/firebolt/connections.py index 6301bfd29..6c311f25d 100644 --- a/dbt/adapters/firebolt/connections.py +++ b/dbt/adapters/firebolt/connections.py @@ -115,7 +115,7 @@ def make_jdbc_url(self, credentials): # variable or as an engine_name value in profiles.yml, it uses the # engine Firebolt has set as default for this DB. jdbc_url += f"?engine={urllib.parse.quote(credentials.engine_name)}" - + print(f'** jdbc url: {jdbc_url}') return jdbc_url @contextmanager From 38b220b8d446698356482808cd9fc4a3b0c26aec Mon Sep 17 00:00:00 2001 From: Eric Ford Date: Mon, 1 Nov 2021 15:16:06 -0400 Subject: [PATCH 3/6] Properly composed url string. --- dbt/adapters/firebolt/connections.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dbt/adapters/firebolt/connections.py b/dbt/adapters/firebolt/connections.py index a413abba8..9f4a66dce 100644 --- a/dbt/adapters/firebolt/connections.py +++ b/dbt/adapters/firebolt/connections.py @@ -100,10 +100,7 @@ def open(cls, connection): return connection def make_jdbc_url(self, credentials): - jdbc_url = urljoin('jdbc:firebolt://', - credentials.host, - credentials.database - ) + jdbc_url = f'jdbc:firebolt://{credentials.host}/{credentials.database}' if credentials.params: jdbc_url += "".join( map( @@ -129,7 +126,6 @@ def make_jdbc_url(self, credentials): }) if url_vars: jdbc_url += "?" + urlencode(url_vars) - print(url_vars) return jdbc_url @contextmanager From 4413543d81f260adcaf29bf1525c332f6d5ff09d Mon Sep 17 00:00:00 2001 From: swanderz Date: Mon, 1 Nov 2021 13:53:00 -0700 Subject: [PATCH 4/6] bump version --- dbt/adapters/firebolt/__version__.py | 2 +- dev-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt/adapters/firebolt/__version__.py b/dbt/adapters/firebolt/__version__.py index 3fd4981d4..c34baa9c7 100644 --- a/dbt/adapters/firebolt/__version__.py +++ b/dbt/adapters/firebolt/__version__.py @@ -1 +1 @@ -version = "0.21.1" +version = "0.21.2" diff --git a/dev-requirements.txt b/dev-requirements.txt index 749d783f5..3d1060981 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ pytest~=0.6.2 pytest-dbt-adapter==0.5.1 -dbt-core~=0.20.0 +dbt-core~=0.21.0 . \ No newline at end of file From 8c4007975b8766e0160b296ce68f5eaa6ae75d0c Mon Sep 17 00:00:00 2001 From: swanderz Date: Mon, 1 Nov 2021 13:53:26 -0700 Subject: [PATCH 5/6] update changelog --- CHANGELOG.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8223bb66f..35fe2a0ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,24 @@ # Changelog +## v.0.21.2 + +### Breaking Changes + +- `engine_name` has been renamed to `engine` please update your `profiles.yml` accordingly [#4](https://github.com/firebolt-db/dbt-firebolt/pull/4) +### Features + +- added ability to specify an account for users who have more than one account associated with their credentials [#4](https://github.com/firebolt-db/dbt-firebolt/pull/4) +### Fixes + +- fixed bug where database connection URL used backslashes on Windows due to `os.path.join` [#5](https://github.com/firebolt-db/dbt-firebolt/pull/5) + + ## v.0.21.1 ### Fixes - removed log statements and an extra `firebolt__get_create_index_sql` macro error via [#2](https://github.com/firebolt-db/dbt-firebolt/pull/2) -- added ability to specify an account for users who have more than one account associated with their credentials - ## v.0.21.0 From 1c86325ff8208e8dea87946f1fc6d1863e35a037 Mon Sep 17 00:00:00 2001 From: Eric Ford Date: Mon, 1 Nov 2021 16:56:36 -0400 Subject: [PATCH 6/6] Update connections.py No longer need urljoin import. --- dbt/adapters/firebolt/connections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/adapters/firebolt/connections.py b/dbt/adapters/firebolt/connections.py index 9f4a66dce..ee67d1659 100644 --- a/dbt/adapters/firebolt/connections.py +++ b/dbt/adapters/firebolt/connections.py @@ -1,7 +1,7 @@ from contextlib import contextmanager from dataclasses import dataclass from typing import Optional, Dict, List, Any, Iterable -from urllib.parse import quote, urlencode, urljoin +from urllib.parse import quote, urlencode import os import json import agate