-
Notifications
You must be signed in to change notification settings - Fork 107
feat(datasets): support TableDataset credentials
#1218
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
Merged
ankatiyar
merged 19 commits into
kedro-org:main
from
gitgud5000:ibis-ds-credentials-support
Oct 28, 2025
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f79f46d
Add credentials parameter to TableDataset for authentication
gitgud5000 1e65087
Add tests for TableDataset credentials functionality
gitgud5000 74cbed1
test(ibis): suppress false positive secret warning
gitgud5000 90db8d2
style(tests): apply lint and formatting fixes
gitgud5000 13e8b3b
fix(ibis): add credentials type validation to TableDataset. Appease m…
gitgud5000 bac6695
fix(ibis): Fix formatting and lint issues
gitgud5000 ce728b9
fix: secret false positive
gitgud5000 a7a3159
fix: formatting
gitgud5000 6bc347c
fix(tests): remove commented-out references from upstream examples
gitgud5000 9f68826
fix(RELEASE.md): update documentation for `ibis.TableDataset` with mo…
gitgud5000 59d72c5
fix: docs
gitgud5000 2f8d692
fix: docs...
gitgud5000 d1747ef
Merge branch 'kedro-org:main' into ibis-ds-credentials-support
gitgud5000 cdf8381
Merge branch 'main' into ibis-ds-credentials-support
deepyaman 1071862
Address comments by @deepyaman: simplify `TableDataset` credentials m…
gitgud5000 cae37e8
fix credentials type annotation to resolves a mypy false positive.
gitgud5000 5397294
feat(schema): add optional credentials object to catalog JSON schema
gitgud5000 216cb26
fix test determine backend from dataset config and add credentials-ov…
gitgud5000 34af7b6
Merge branch 'main' into ibis-ds-credentials-support
deepyaman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,12 +38,24 @@ def connection_config(request, database): | |
| ) | ||
|
|
||
|
|
||
| @pytest.fixture(params=[_SENTINEL]) | ||
| def credentials_config(request, database): | ||
| return ( | ||
| None | ||
| if request.param is _SENTINEL # `None` is a valid value to test | ||
| else request.param | ||
| ) | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def table_dataset(database_name, connection_config, load_args, save_args): | ||
| def table_dataset( | ||
| database_name, connection_config, credentials_config, load_args, save_args | ||
| ): | ||
| ds = TableDataset( | ||
| table_name="test", | ||
| database=database_name, | ||
| connection=connection_config, | ||
| credentials=credentials_config, | ||
| load_args=load_args, | ||
| save_args=save_args, | ||
| ) | ||
|
|
@@ -348,6 +360,61 @@ def test_connection_config(self, mocker, table_dataset, connection_config, key): | |
| table_dataset.load() | ||
| assert ("ibis", key) in table_dataset._connections | ||
|
|
||
| @pytest.mark.parametrize( | ||
| ("connection_config", "credentials_config", "key"), | ||
| [ | ||
| ( | ||
| {"backend": "duckdb", "database": "file.db", "extensions": ["spatial"]}, | ||
| {"user": "admin", "password": "secret"}, # pragma: allowlist secret | ||
| ( | ||
| ("backend", "duckdb"), | ||
| ("database", "file.db"), | ||
| ("extensions", ("spatial",)), | ||
| ("password", "secret"), | ||
| ("user", "admin"), | ||
| ), | ||
| ), | ||
| ( | ||
| [], | ||
| { | ||
| "host": "xxx.sql.azuresynapse.net", | ||
| "database": "xxx", | ||
| "query": {"driver": "ODBC Driver 17 for SQL Server"}, | ||
| "backend": "mssql", | ||
| }, | ||
| ( | ||
| ("backend", "mssql"), | ||
| ("database", "xxx"), | ||
| ("host", "xxx.sql.azuresynapse.net"), | ||
| ("query", (("driver", "ODBC Driver 17 for SQL Server"),)), | ||
| ), | ||
| ), | ||
| ( | ||
| None, | ||
| None, | ||
| ( | ||
| ("backend", "duckdb"), | ||
| ("database", ":memory:"), | ||
| ), | ||
| ), | ||
| ( | ||
| {"backend": "duckdb", "database": "file.db"}, | ||
| {"backend": "mssql", "password": "secret"}, # pragma: allowlist secret | ||
| ( | ||
| ("backend", "mssql"), | ||
| ("database", "file.db"), | ||
| ("password", "secret"), | ||
| ), | ||
| ), | ||
| ], | ||
| indirect=["connection_config", "credentials_config"], | ||
| ) | ||
| def test_connection_config_with_credentials(self, mocker, table_dataset, key): | ||
| backend = table_dataset._connection_config["backend"] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, much simpler. 🤦♂️ |
||
| mocker.patch(f"ibis.{backend}") | ||
| table_dataset.load() | ||
| assert ("ibis", key) in table_dataset._connections | ||
|
|
||
| def test_save_data_loaded_using_file_dataset(self, file_dataset, table_dataset): | ||
| """Test interoperability of Ibis datasets sharing a database.""" | ||
| dummy_table = file_dataset.load() | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.