Skip to content

Commit

Permalink
Clears adapters before registering to fix dbt-server cacheing behavior (
Browse files Browse the repository at this point in the history
  • Loading branch information
racheldaniel authored Nov 8, 2021
1 parent f20e83a commit 229e897
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Bump artifact schema versions for 1.0.0: manifest v4, run results v4, sources v3. Notable changes: schema test + data test nodes are renamed to generic test + singular test nodes; freshness threshold default values ([#4191](https://github.com/dbt-labs/dbt-core/pull/4191))
- Speed up node selection by skipping `incorporate_indirect_nodes` if not needed ([#4213](https://github.com/dbt-labs/dbt-core/issues/4213), [#4214](https://github.com/dbt-labs/dbt-core/issues/4214))
- When on_schema_change is set, pass common columns as dest_columns in incremental merge macros ([#4144](https://github.com/dbt-labs/dbt-core/issues/4144), [#4170](https://github.com/dbt-labs/dbt-core/pull/4170))
- Clear adapters before registering in lib module config generation ([#4218](https://github.com/dbt-labs/dbt-core/pull/4218))

Contributors:
- [@kadero](https://github.com/kadero) ([#3955](https://github.com/dbt-labs/dbt-core/pull/3955))
Expand Down
3 changes: 3 additions & 0 deletions core/dbt/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def get_dbt_config(project_dir, single_threaded=False):
config = RuntimeConfig.from_args(RuntimeArgs(
project_dir, profiles_dir, single_threaded
))
# Clear previously registered adapters--
# this fixes cacheing behavior on the dbt-server
dbt.adapters.factory.reset_adapters()
# Load the relevant adapter
dbt.adapters.factory.register_adapter(config)

Expand Down

0 comments on commit 229e897

Please sign in to comment.