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

Fixed issue when Databricks SDK config objects were overridden for installation config files #170

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

FastLee
Copy link
Contributor

@FastLee FastLee commented Nov 13, 2024

closes #169

Copy link

github-actions bot commented Nov 13, 2024

✅ 40/40 passed, 2 skipped, 1m44s total

Running from acceptance #239

Copy link

github-actions bot commented Nov 13, 2024

This PR breaks backwards compatibility for databrickslabs/ucx downstream. See build logs for more details.

Running from downstreams #202

Copy link

This PR breaks backwards compatibility for databrickslabs/lsql downstream. See build logs for more details.

Running from downstreams #202

@FastLee FastLee force-pushed the fix/client_config_override_169 branch from e0b963c to 887b797 Compare November 13, 2024 21:00
@@ -25,6 +25,7 @@
get_type_hints,
runtime_checkable,
)
from unittest.mock import create_autospec
Copy link
Collaborator

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()
Copy link
Collaborator

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.

@nfx nfx changed the title Addressed issue with "connect" parameter Fixed issue when Databricks SDK config objects were overridden for installation config files Nov 14, 2024
Copy link
Collaborator

@nfx nfx left a 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.

@nfx nfx merged commit ab4edc6 into main Nov 14, 2024
10 checks passed
@nfx nfx deleted the fix/client_config_override_169 branch November 14, 2024 10:59
nfx added a commit that referenced this pull request Nov 14, 2024
* 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.
@nfx nfx mentioned this pull request Nov 14, 2024
nfx added a commit that referenced this pull request Nov 14, 2024
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Installation._unmarshal initializes databricks.sdk.core.Config when the value is None
2 participants