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

Fix module field reference on PluginConfig for MD #357

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion dbt/adapters/duckdb/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def __post_init__(self):
if self.is_motherduck:
if self.plugins is None:
self.plugins = []
if "motherduck" not in [plugin["module"] for plugin in self.plugins]:
if "motherduck" not in [plugin.module for plugin in self.plugins]:
self.plugins.append(PluginConfig(module="motherduck"))

@property
Expand Down
3 changes: 2 additions & 1 deletion tests/functional/plugins/test_motherduck.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from dbt.adapters.duckdb.credentials import DuckDBCredentials
from dbt.adapters.duckdb.credentials import PluginConfig
from dbt.adapters.duckdb.plugins.motherduck import Plugin
from dbt.adapters.duckdb.__version__ import version as plugin_version
from dbt.version import __version__

random_logs_sql = """
Expand Down Expand Up @@ -138,7 +139,7 @@ def test_motherduck_user_agent(dbt_profile_target, mock_plugins, mock_creds):
kwargs = {
'read_only': False,
'config': {
'custom_user_agent': f'dbt/{__version__} downstream-dep',
'custom_user_agent': f'dbt/{__version__} dbt-duckdb/{plugin_version} downstream-dep',
'motherduck_token': 'quack'
}
}
Expand Down
Loading