Skip to content

Commit fad76e8

Browse files
Release v0.11.2 (#251)
* Allow login URLs as profile `host` when configuring the workspace/admin client for CLI commands ([#250](#250)). The handling of the `DATABRICKS_HOST` environment variable has been modified to ensure consistent normalization of the host URL with the Databricks Go SDK, resolving a host normalization issue that previously arose from differences in SDK implementations. Two new methods, `fix_databricks_host` and `_patch_databricks_host`, have been introduced to emulate the Go SDK's host normalization and update the environment variable if necessary. The `fix_databricks_host` method normalizes the host URL by parsing it and creating a new URL instance with empty path, parameters, query, and fragment if the netloc is empty, while the `_patch_databricks_host` method checks and updates the `DATABRICKS_HOST` environment variable accordingly. This change enables the Python SDK to receive a normalized host URL, allowing the labs CLI integration to work correctly, and updates the `needs_workspace_client` and `is_account` checks to use the normalized host URL when creating workspace or account clients. Additionally, several unit tests have been added to verify the correctness of the normalization and patching functionality for different host value types and client scenarios.
1 parent f06b35e commit fad76e8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Version changelog
22

3+
## 0.11.2
4+
5+
* Allow login URLs as profile `host` when configuring the workspace/admin client for CLI commands ([#250](https://github.com/databrickslabs/blueprint/issues/250)). The handling of the `DATABRICKS_HOST` environment variable has been modified to ensure consistent normalization of the host URL with the Databricks Go SDK, resolving a host normalization issue that previously arose from differences in SDK implementations. Two new methods, `fix_databricks_host` and `_patch_databricks_host`, have been introduced to emulate the Go SDK's host normalization and update the environment variable if necessary. The `fix_databricks_host` method normalizes the host URL by parsing it and creating a new URL instance with empty path, parameters, query, and fragment if the netloc is empty, while the `_patch_databricks_host` method checks and updates the `DATABRICKS_HOST` environment variable accordingly. This change enables the Python SDK to receive a normalized host URL, allowing the labs CLI integration to work correctly, and updates the `needs_workspace_client` and `is_account` checks to use the normalized host URL when creating workspace or account clients. Additionally, several unit tests have been added to verify the correctness of the normalization and patching functionality for different host value types and client scenarios.
6+
7+
38
## 0.11.1
49

510
* Expose the number of available CPUs for concurrent processing ([#244](https://github.com/databrickslabs/blueprint/issues/244)). The library now provides a method to determine the number of logical CPUs available for the current process, considering factors such as containerized environments where the available CPU quota may differ from the total number of CPUs present. This method checks for the availability of the `process_cpu_count` attribute, and if not available, attempts to use the `sched_getaffinity` function on Linux or falls back to the total number of CPUs in the system, defaulting to 1 if unknown. The `gather` method has been updated to utilize this new method, allowing for more accurate determination of the available CPU count and improved concurrency. Additionally, several test cases have been added to verify the correct behavior of the method, including scenarios where the count is retrieved from different sources, ensuring a reliable way to determine the available CPU count for configuring concurrent processing in downstream applications.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.11.1"
1+
__version__ = "0.11.2"

0 commit comments

Comments
 (0)