Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Bump version number and update adapter to work with dbt v1.0.0 #38

Merged
merged 39 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6a5e78f
Pulled out JDBC connection code and replaced it with our DB-API conne…
ima-hima Nov 4, 2021
be7fffe
Hand merged main.
ima-hima Nov 4, 2021
ada17c7
dbt debug shows we're making connections. Seeding is failing with typ…
ima-hima Nov 4, 2021
eb13df0
Can connect to the database and dbt run, but dbt seed isn't currently…
ima-hima Nov 10, 2021
ce63457
add dbt debugging
dataders Nov 12, 2021
088bae5
Little bit of cleanup. Mostly removed a couple of references to and u…
ima-hima Nov 16, 2021
59582ba
Hand merge of setup.py.
ima-hima Nov 16, 2021
decc422
deprecate JDBC java type conversion hacks
dataders Nov 16, 2021
3ba3f14
Merge branch 'main' of https://github.com/firebolt-db/dbt-firebolt in…
dataders Nov 16, 2021
433e9b1
Update setup.py
dataders Nov 30, 2021
9962fa0
Hand merged auto-merge conflicts from main.
ericf-firebolt Dec 22, 2021
b437ee9
Updated a couple of variable names and the setup.py file.
ericf-firebolt Dec 22, 2021
149baf7
Updated account and engine to account_name and engine_name in connect…
ericf-firebolt Dec 22, 2021
24eaed9
Merge branch 'move_to_our_db_api' of https://github.com/firebolt-db/d…
ericf-firebolt Dec 22, 2021
351f72f
Hand-merged failed auto-merged. Also updated SDK version in our requi…
ericf-firebolt Jan 18, 2022
6bb3cd5
Updated method of getting credentials in connection.py.
ericf-firebolt Jan 18, 2022
3c791cc
Bumped version number and dbt dependency.
ericf-firebolt Jan 21, 2022
12fa4f8
Minor edits to catalog.sql for cleanup.
ericf-firebolt Jan 21, 2022
b5b4136
Changed env variable names in tests/integration/firebolt.dbtspec for …
ericf-firebolt Jan 21, 2022
f926edb
Hand-merged a failed auto-merge from main.
ericf-firebolt Jan 24, 2022
769bb61
Bumped version number.
ericf-firebolt Jan 24, 2022
261ad19
Fixed failed automerge.
ericf-firebolt Jan 24, 2022
118f677
Bumped version number.
ericf-firebolt Jan 24, 2022
ae41b11
Fixed failed automerge.
ericf-firebolt Jan 24, 2022
e8f3566
Fixed incorrect version number.
ericf-firebolt Jan 24, 2022
1456709
Bumped version number.
ericf-firebolt Jan 25, 2022
a868f17
Merge branch 'main' into move_to_our_db_api
ericf-firebolt Jan 27, 2022
105fc9c
Removed jaydebeapi from the installation requirements.
ericf-firebolt Jan 27, 2022
805db71
Finished merge from move_to_our_db_api.
ericf-firebolt Jan 27, 2022
6a1778e
Removed unnecessary init file and renamed tests directory.
ericf-firebolt Jan 27, 2022
83e2e7c
Added firebolt-sdk >= 0.3.2 as a required install.
ericf-firebolt Jan 28, 2022
926dc62
Removed get_status() from connections.py.
ericf-firebolt Jan 28, 2022
1ae6c1c
Merge branch 'move_to_our_db_api' into move-to-dbt-1-point-0
ericf-firebolt Jan 28, 2022
ed1d0c4
Updated .dbtspec pytest file to get schema name from environment.
ericf-firebolt Jan 31, 2022
2249e36
Bumped required version number of SDK.
ericf-firebolt Feb 2, 2022
e0a2767
Merge branch 'main' into move-to-dbt-1-point-0
ericf-firebolt Feb 3, 2022
5dad27e
Found an removed an extraneous mention of JDBC in an error msg.
ericf-firebolt Feb 7, 2022
ef7b970
Removed EngineOfflineException from connections.py.
ericf-firebolt Feb 8, 2022
462a005
Hard-coded schema in .dbtspec file.
ericf-firebolt Feb 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# Changelog

## v.0.21.9
## v.1.0.0

- dbt-firebolt now supports dbt 1.0+!

## v.0.21.10

### Breaking changes

- We now use our [DB-API](https://github.com/firebolt-db/firebolt-python-sdk) rather than our JDBC.

## v.0.21.9

### Under the hood

- Bug fixes to do with pull request linting.
– Also for PRs, moved to conventional commmits.

## v.0.21.8

### Under the hood
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The [dbt](https://www.getdbt.com) adapter for [Firebolt](https://www.firebolt.io
* Declarative, version-controlled data modeling
* Auto-generated data lineage and documentation

dbt-firebolt supports dbt 0.21+.
dbt-firebolt supports dbt 1.0+.


## Installation
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/firebolt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dbt.adapters.firebolt.impl import FireboltAdapter
from dbt.include import firebolt

__version__ = '0.21.10'
__version__ = '1.0.0'

Plugin = AdapterPlugin(
adapter=FireboltAdapter,
Expand Down
60 changes: 10 additions & 50 deletions dbt/adapters/firebolt/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,39 +73,16 @@ def open(cls, connection):
return connection
credentials = connection.credentials

try:
# Create a connection based on provided credentials.
connection.handle = connect(
engine_name=credentials.engine_name,
database=credentials.database,
username=credentials.user,
password=credentials.password,
api_endpoint=credentials.api_endpoint,
account_name=credentials.account_name,
)
connection.state = 'open'
except Exception as e:
connection.handle = None
connection.state = 'fail'
# If we get a 502 or 503 error, maybe engine isn't running.
if '50' in f'{e}':
if credentials.engine_name is None:
error_msg_append = (
'\nTo specify a non-default engine, '
'add an engine_name field into the appropriate '
'target in your '
'profiles.yml file.'
)
else:
engine_name = credentials.engine_name
error_msg_append = ''
raise EngineOfflineException(
f'Failed to connect via JDBC. Is the {engine_name} '
+ f'engine for {credentials.database} running? '
+ error_msg_append
)

raise dbt.exceptions.FailedToConnectException(str(e))
# Create a connection based on provided credentials.
connection.handle = connect(
engine_name=credentials.engine_name,
database=credentials.database,
username=credentials.user,
password=credentials.password,
api_endpoint=credentials.api_endpoint,
account_name=credentials.account_name,
)
connection.state = 'open'
return connection

@contextmanager
Expand Down Expand Up @@ -154,20 +131,3 @@ def cancel(self, connection):

def set_query_header(self, manifest: Manifest) -> None:
self.query_header = None


class EngineOfflineException(Exception):
CODE = 10003
MESSAGE = 'Connection Error'

def process_stack(self):
lines = []

if hasattr(self.node, 'build_path') and self.node.build_path:
lines.append(f'compiled SQL at {self.node.build_path}')

return lines + RuntimeException.process_stack(self)

@property
def type(self):
return 'firebolt'
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ project_urls =
[options]
packages = find_namespace:
install_requires =
firebolt-sdk>=0.3.2
firebolt-sdk>=0.4
python_requires = >=3.7
include_package_data = True
package_dir =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ target:
schema: test
port: 443
threads: 1

sequences:
test_dbt_empty: empty
# test_dbt_base: base
Expand Down