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

Add custom_user_agent to connection config when connecting to MotherDuck #333

Merged
Changes from 1 commit
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
Prev Previous commit
reorder lines in UT
guenp committed Feb 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit c84f8841a764be2cf30019b4ec3142eae51db789
8 changes: 4 additions & 4 deletions tests/functional/plugins/test_motherduck.py
Original file line number Diff line number Diff line change
@@ -107,14 +107,14 @@ def test_incremental(self, project):

def test_motherduck_user_agent(dbt_profile_target):
test_path = dbt_profile_target["path"]
kwargs = {
'read_only': False,
'config': {'custom_user_agent': f'dbt/{__version__}'}
}
creds = DuckDBCredentials(path=test_path)
with mock.patch("dbt.adapters.duckdb.environments.duckdb.connect") as mock_connect:
Environment.initialize_db(creds)
if creds.is_motherduck:
kwargs = {
'read_only': False,
'config': {'custom_user_agent': f'dbt/{__version__}'}
}
mock_connect.assert_called_with(test_path, **kwargs)
else:
mock_connect.assert_called_with(test_path, read_only=False, config = {})