Merged
Conversation
279eeeb to
670997d
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for named secrets in DuckDB connections, allowing multiple secrets per connection either as a list or a dict with custom names.
- Extends the
secretsconfig type and initialization to handle dict-based named secrets. - Updates tests to cover both list and dict formats for DuckDB secrets.
- Revises examples and documentation to illustrate named and default secret usage.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/core/test_connection_config.py | Added tests for multiple and named DuckDB secrets |
| sqlmesh/core/config/connection.py | Changed secrets field type and init logic for naming |
| examples/sushi/config.py | Updated example to show named secret configuration |
| docs/integrations/engines/duckdb.md | Expanded docs with list vs. dict formats for secrets |
Comments suppressed due to low confidence (3)
tests/core/test_connection_config.py:7
- The test uses
callin assertions but does not import it from unittest.mock; addcallto the import to avoid a NameError.
from unittest.mock import patch, MagicMock
sqlmesh/core/config/connection.py:280
- Using a mutable default for the
secretsfield can lead to shared state issues; consider usingField(default_factory=list)(or equivalent) for list defaults ordefault_factory=dictwhen appropriate.
secrets: t.Union[t.List[t.Dict[str, t.Any]], t.Dict[str, t.Dict[str, t.Any]]] = []
sqlmesh/core/config/connection.py:380
- [nitpick] When
secret_nameis empty, this generates an extra space in the SQL (CREATE SECRET ...); consider conditionally adding the space only when a name is provided.
cursor.execute(f"CREATE SECRET {secret_name} ({secret_clause});")
eakmanrq
commented
Jul 4, 2025
Comment on lines
+354
to
+356
| type: ducklake | ||
| path: myducklakecatalog.duckdb | ||
| data_path: abfs://MyFabricWorkspace/MyFabricLakehouse.Lakehouse/Files/DuckLake.Files |
Contributor
Author
There was a problem hiding this comment.
This is a typo I found while reviewing the docs after the change in this PR
670997d to
0b2c602
Compare
themisvaltinos
approved these changes
Jul 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to this PR, users were forced to use the default secret name when creating secrets. Now they can still do that or create secrets with a specific name. This is required to support a use case where users want to define multiple secrets for a single type (ex: multiple secrets for S3) since before they would get an error saying the default name was already defined.