-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fixed issue when Databricks SDK config objects were overridden for installation config files #170
Conversation
✅ 40/40 passed, 2 skipped, 1m44s total Running from acceptance #239 |
This PR breaks backwards compatibility for databrickslabs/ucx downstream. See build logs for more details. Running from downstreams #202 |
This PR breaks backwards compatibility for databrickslabs/lsql downstream. See build logs for more details. Running from downstreams #202 |
e0b963c
to
887b797
Compare
@@ -25,6 +25,7 @@ | |||
get_type_hints, | |||
runtime_checkable, | |||
) | |||
from unittest.mock import create_autospec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you cannot include unit-testing dependencies in the production code.
"""The `_marshal_databricks_config` method is a private method that is used to serialize an object of type | ||
`databricks.sdk.core.Config` to a dictionary. This method is called by the `save` method.""" | ||
if not inst: | ||
return None, False | ||
return inst.as_dict(), True | ||
current_client_config = self._ws.config.as_dict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor self._ws.config.as_dict()
to a private cached property, which you override in MockInstallation
to avoid unittest dependency that does not belong to this module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've fixed the issues.
* Fixed issue when Databricks SDK config objects were overridden for installation config files ([#170](#170)). This commit addresses an issue where Databricks SDK config objects were being overridden during installation config files creation, which has been resolved by modifying the `_marshal` method in the `installation` class to handle `databricks.sdk.core.Config` instances more carefully, and by introducing a new helper function `get_databricks_sdk_config` in the `paths.py` file, which retrieves the Databricks SDK configuration and improves the reliability and robustness of the SDK configuration. This fixes bug [#169](#169) and ensures that the SDK configuration is not accidentally modified during the installation process, preventing unexpected behavior and errors. The changes are isolated to the `paths.py` file and do not affect other parts of the codebase.
* Fixed issue when Databricks SDK config objects were overridden for installation config files ([#170](#170)). This commit addresses an issue where Databricks SDK config objects were being overridden during installation config files creation, which has been resolved by modifying the `_marshal` method in the `installation` class to handle `databricks.sdk.core.Config` instances more carefully, and by introducing a new helper function `get_databricks_sdk_config` in the `paths.py` file, which retrieves the Databricks SDK configuration and improves the reliability and robustness of the SDK configuration. This fixes bug [#169](#169) and ensures that the SDK configuration is not accidentally modified during the installation process, preventing unexpected behavior and errors. The changes are isolated to the `paths.py` file and do not affect other parts of the codebase.
closes #169