-
Notifications
You must be signed in to change notification settings - Fork 128
Update Lakebase authentication method #975
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
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
91a2d62
refactor: update lakebase authentication option for databricks apps
tlgnr cf0c4c7
chore: update unit tests for revised lakebase authentication method
tlgnr 97aa669
chore: update lakebase integration tests
tlgnr ada8ba9
chore: disable unused-argument pylint check on function that requires…
tlgnr dac9ec8
chore: merge in changes from main
tlgnr df1946e
docs: harmonize doctstring
tlgnr 492ee5c
docs: update installation docs
tlgnr 4b57a44
chore: remove pylint comment
tlgnr 83bfbd6
chore: implement minor improvements
tlgnr 4ea0745
chore: run one test without client id
tlgnr 61334c1
Merge branch 'main' into feature/update_lakebase_auth
mwojtyczka 668dd07
fmt
mwojtyczka 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
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 |
|---|---|---|
|
|
@@ -8,24 +8,31 @@ | |
| from tests.integration.test_save_and_load_checks_from_table import EXPECTED_CHECKS as TEST_CHECKS | ||
|
|
||
|
Contributor
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. it would be good to have one test without client id |
||
|
|
||
| def test_load_checks_when_lakebase_table_does_not_exist(ws, spark, make_lakebase_instance, lakebase_user, make_random): | ||
| def test_load_checks_when_lakebase_table_does_not_exist( | ||
| ws, spark, make_lakebase_instance, lakebase_client_id, make_random | ||
| ): | ||
| dq_engine = DQEngine(ws, spark) | ||
|
|
||
| instance = make_lakebase_instance() | ||
| lakebase_location = _create_lakebase_location(instance.database_name, make_random) | ||
| config = LakebaseChecksStorageConfig(location=lakebase_location, user=lakebase_user, instance_name=instance.name) | ||
|
|
||
| config = LakebaseChecksStorageConfig( | ||
| location=lakebase_location, client_id=lakebase_client_id, instance_name=instance.name | ||
| ) | ||
|
|
||
| with pytest.raises(NotFound, match=f"Table '{config.location}' does not exist in the Lakebase instance"): | ||
| dq_engine.load_checks(config=config) | ||
|
|
||
|
|
||
| def test_save_and_load_checks_from_lakebase_table(ws, spark, make_lakebase_instance, lakebase_user, make_random): | ||
| def test_save_and_load_checks_from_lakebase_table(ws, spark, make_lakebase_instance, lakebase_client_id, make_random): | ||
| dq_engine = DQEngine(ws, spark) | ||
|
|
||
| instance = make_lakebase_instance() | ||
| lakebase_location = _create_lakebase_location(instance.database_name, make_random) | ||
|
|
||
| config = LakebaseChecksStorageConfig(location=lakebase_location, user=lakebase_user, instance_name=instance.name) | ||
| config = LakebaseChecksStorageConfig( | ||
| location=lakebase_location, client_id=lakebase_client_id, instance_name=instance.name | ||
| ) | ||
|
|
||
| dq_engine.save_checks(checks=TEST_CHECKS, config=config) | ||
| checks = dq_engine.load_checks(config=config) | ||
|
|
@@ -34,25 +41,31 @@ def test_save_and_load_checks_from_lakebase_table(ws, spark, make_lakebase_insta | |
|
|
||
|
|
||
| def test_save_and_load_checks_from_lakebase_table_with_run_config( | ||
| ws, spark, make_lakebase_instance, lakebase_user, make_random | ||
| ws, spark, make_lakebase_instance, lakebase_client_id, make_random | ||
| ): | ||
| dq_engine = DQEngine(ws, spark) | ||
|
|
||
| instance = make_lakebase_instance() | ||
| lakebase_location = _create_lakebase_location(instance.database_name, make_random) | ||
|
|
||
| # test first run config | ||
| # test the first run config | ||
| config = LakebaseChecksStorageConfig( | ||
| location=lakebase_location, user=lakebase_user, instance_name=instance.name, run_config_name="workflow_001" | ||
| location=lakebase_location, | ||
| client_id=lakebase_client_id, | ||
| instance_name=instance.name, | ||
| run_config_name="workflow_001", | ||
| ) | ||
| dq_engine.save_checks(TEST_CHECKS[:1], config=config) | ||
| checks = dq_engine.load_checks(config=config) | ||
|
|
||
| compare_checks(checks, TEST_CHECKS[:1]) | ||
|
|
||
| # test second run config | ||
| # test the second run config | ||
| second_config = LakebaseChecksStorageConfig( | ||
| location=lakebase_location, user=lakebase_user, instance_name=instance.name, run_config_name="workflow_002" | ||
| location=lakebase_location, | ||
| client_id=lakebase_client_id, | ||
| instance_name=instance.name, | ||
| run_config_name="workflow_002", | ||
| ) | ||
| dq_engine.save_checks(TEST_CHECKS[1:], config=second_config) | ||
| checks = dq_engine.load_checks(config=second_config) | ||
|
|
@@ -61,7 +74,7 @@ def test_save_and_load_checks_from_lakebase_table_with_run_config( | |
|
|
||
|
|
||
| def test_save_and_load_checks_from_lakebase_table_with_output_modes( | ||
| ws, spark, make_lakebase_instance, lakebase_user, make_random | ||
| ws, spark, make_lakebase_instance, lakebase_client_id, make_random | ||
| ): | ||
| dq_engine = DQEngine(ws, spark) | ||
|
|
||
|
|
@@ -73,7 +86,7 @@ def test_save_and_load_checks_from_lakebase_table_with_output_modes( | |
| TEST_CHECKS[:1], | ||
| config=LakebaseChecksStorageConfig( | ||
| location=lakebase_location, | ||
| user=lakebase_user, | ||
| client_id=lakebase_client_id, | ||
| instance_name=instance.name, | ||
| run_config_name=run_config_name, | ||
| mode="append", | ||
|
|
@@ -83,7 +96,7 @@ def test_save_and_load_checks_from_lakebase_table_with_output_modes( | |
| checks = dq_engine.load_checks( | ||
| config=LakebaseChecksStorageConfig( | ||
| location=lakebase_location, | ||
| user=lakebase_user, | ||
| client_id=lakebase_client_id, | ||
| instance_name=instance.name, | ||
| run_config_name=run_config_name, | ||
| ) | ||
|
|
@@ -95,7 +108,7 @@ def test_save_and_load_checks_from_lakebase_table_with_output_modes( | |
| TEST_CHECKS[1:], | ||
| config=LakebaseChecksStorageConfig( | ||
| location=lakebase_location, | ||
| user=lakebase_user, | ||
| client_id=lakebase_client_id, | ||
| instance_name=instance.name, | ||
| run_config_name=run_config_name, | ||
| mode="overwrite", | ||
|
|
@@ -104,7 +117,7 @@ def test_save_and_load_checks_from_lakebase_table_with_output_modes( | |
| checks = dq_engine.load_checks( | ||
| config=LakebaseChecksStorageConfig( | ||
| location=lakebase_location, | ||
| user=lakebase_user, | ||
| client_id=lakebase_client_id, | ||
| instance_name=instance.name, | ||
| run_config_name=run_config_name, | ||
| ) | ||
|
|
@@ -113,7 +126,7 @@ def test_save_and_load_checks_from_lakebase_table_with_output_modes( | |
|
|
||
|
|
||
| def test_save_and_load_checks_from_lakebase_table_with_user_installation( | ||
| ws, spark, installation_ctx, make_lakebase_instance, lakebase_user, make_random | ||
| ws, spark, installation_ctx, make_lakebase_instance, lakebase_client_id, make_random | ||
| ): | ||
| instance = make_lakebase_instance() | ||
|
|
||
|
|
@@ -125,7 +138,7 @@ def test_save_and_load_checks_from_lakebase_table_with_user_installation( | |
|
|
||
| config = InstallationChecksStorageConfig( | ||
| instance_name=instance.name, | ||
| user=lakebase_user, | ||
| client_id=lakebase_client_id, | ||
| run_config_name=run_config.name, | ||
| product_name=product_name, | ||
| assume_user=True, | ||
|
|
@@ -140,7 +153,7 @@ def test_save_and_load_checks_from_lakebase_table_with_user_installation( | |
|
|
||
|
|
||
| def test_profiler_workflow_save_to_lakebase( | ||
| ws, spark, setup_workflows, make_lakebase_instance, lakebase_user, make_random | ||
| ws, spark, setup_workflows, make_lakebase_instance, lakebase_client_id, make_random | ||
| ): | ||
| installation_ctx, run_config = setup_workflows() | ||
|
|
||
|
|
@@ -150,7 +163,7 @@ def test_profiler_workflow_save_to_lakebase( | |
| config = installation_ctx.config | ||
| run_config = config.get_run_config() | ||
| run_config.checks_location = lakebase_location | ||
| run_config.lakebase_user = lakebase_user | ||
| run_config.lakebase_client_id = lakebase_client_id | ||
| run_config.lakebase_instance_name = instance.name | ||
| run_config.lakebase_port = "5432" | ||
|
|
||
|
|
@@ -161,7 +174,10 @@ def test_profiler_workflow_save_to_lakebase( | |
| dq_engine = DQEngine(ws, spark) | ||
| checks = dq_engine.load_checks( | ||
| config=LakebaseChecksStorageConfig( | ||
| location=lakebase_location, instance_name=instance.name, user=lakebase_user, run_config_name=run_config.name | ||
| location=lakebase_location, | ||
| instance_name=instance.name, | ||
| client_id=lakebase_client_id, | ||
| run_config_name=run_config.name, | ||
| ) | ||
| ) | ||
| assert checks, "Checks are missing" | ||
|
|
||
Oops, something went wrong.
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.