Skip to content

Commit

Permalink
Bug: Force dbt to run single-threaded. (#35)
Browse files Browse the repository at this point in the history
* Started adding  variable. Some extra s which are commented out and need to be removed.

* Added macro to adapters.sql to error out when > 1 thread is specified in profiles.yml.

* Bumped version number, because I'll push to PyPI, and updated change log.

* Removed extraneous prints and some function arguments that were leftovers from a previous attempt.

* Since all references to it were removed, deleted get_credentials() from connections.py.
  • Loading branch information
ericf-firebolt authored Jan 11, 2022
1 parent d6cd142 commit e66b88d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v.0.21.7

### Changes

- Disallowed setting of `threads` in `profiles.yml` to a value greater than 1.

## v.0.21.6

### Changes
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/firebolt/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.21.6'
version = '0.21.7'
6 changes: 1 addition & 5 deletions dbt/adapters/firebolt/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class FireboltConnectionManager(SQLConnectionManager):
def open(cls, connection):
if connection.state == 'open':
return connection
credentials = cls.get_credentials(connection.credentials)
credentials = connection.credentials
jdbc_url = cls.make_jdbc_url(cls, credentials)

try:
Expand Down Expand Up @@ -181,10 +181,6 @@ def commit(self):
Firebolt does not yet support transactions.
"""

@classmethod
def get_credentials(cls, credentials):
return credentials

def cancel(self, connection):
"""Cancel the last query on the given connection."""
raise dbt.exceptions.NotImplementedException(
Expand Down
3 changes: 3 additions & 0 deletions dbt/include/firebolt/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@


{% macro firebolt__list_schemas(database) %}
{% if target.threads > 1 %}
{{ exceptions.raise_compiler_error("Firebolt does not currently support more than one thread.") }}
{% endif %}
{% call statement('list_schemas', fetch_result=True, auto_begin=False) %}
SELECT '{{target.schema}}' AS schema
{% endcall %}
Expand Down

0 comments on commit e66b88d

Please sign in to comment.