Skip to content

Commit

Permalink
Release v0.7.0
Browse files Browse the repository at this point in the history
* Added `databricks.labs.blueprint.paths.WorkspacePath` as `pathlib.Path` equivalent ([#115](#115)). This commit introduces the `databricks.labs.blueprint.paths.WorkspacePath` library, providing Python-native `pathlib.Path`-like interfaces to simplify working with Databricks Workspace paths. The library includes `WorkspacePath` and `WorkspacePathDuringTest` classes offering advanced functionality for handling user home folders, relative file paths, browser URLs, and file manipulation methods such as `read/write_text()`, `read/write_bytes()`, and `glob()`. This addition brings enhanced, Pythonic ways to interact with Databricks Workspace paths, including creating and moving files, managing directories, and generating browser-accessible URIs. Additionally, the commit includes updates to existing methods and introduces new fixtures for creating notebooks, accompanied by extensive unit tests to ensure reliability and functionality.
* Added propagation of `blueprint` version into `User-Agent` header when it is used as library ([#114](#114)). A new feature has been introduced in the library that allows for the propagation of the `blueprint` version and the name of the command line interface (CLI) command used in the `User-Agent` header when the library is utilized as a library. This feature includes the addition of two new pairs of `OtherInfo`: `blueprint/X.Y.Z` to indicate that the request is made using the `blueprint` library and `cmd/<name>` to store the name of the CLI command used for making the request. The implementation involves using the `with_user_agent_extra` function from `databricks.sdk.config` to set the user agent consistently with the Databricks CLI. Several changes have been made to the test file for `test_useragent.py` to include a new test case, `test_user_agent_is_propagated`, which checks if the `blueprint` version and the name of the command are correctly propagated to the `User-Agent` header. A context manager `http_fixture_server` has been added that creates an HTTP server with a custom handler, which extracts the `blueprint` version and the command name from the `User-Agent` header and stores them in the `user_agent` dictionary. The test case calls the `foo` command with a mocked `WorkspaceClient` instance and sets the `DATABRICKS_HOST` and `DATABRICKS_TOKEN` environment variables to test the propagation of the `blueprint` version and the command name in the `User-Agent` header. The test case then asserts that the `blueprint` version and the name of the command are present and correctly set in the `user_agent` dictionary.
* Bump actions/checkout from 4.1.6 to 4.1.7 ([#112](#112)). In this release, the version of the "actions/checkout" action used in the `Checkout Code` step of the acceptance workflow has been updated from 4.1.6 to 4.1.7. This update may include bug fixes, performance improvements, and new features, although specific changes are not mentioned in the commit message. The `Unshallow` step remains unchanged, continuing to fetch and clean up the repository's history. This update ensures that the latest enhancements from the "actions/checkout" action are utilized, aiming to improve the reliability and performance of the code checkout process in the GitHub Actions workflow. Software engineers should be aware of this update and its potential impact on their workflows.

Dependency updates:

 * Bump actions/checkout from 4.1.6 to 4.1.7 ([#112](#112)).
  • Loading branch information
nfx committed Jul 5, 2024
1 parent 0ea0db9 commit c89ff4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Version changelog

## 0.7.0

* Added `databricks.labs.blueprint.paths.WorkspacePath` as `pathlib.Path` equivalent ([#115](https://github.com/databrickslabs/blueprint/issues/115)). This commit introduces the `databricks.labs.blueprint.paths.WorkspacePath` library, providing Python-native `pathlib.Path`-like interfaces to simplify working with Databricks Workspace paths. The library includes `WorkspacePath` and `WorkspacePathDuringTest` classes offering advanced functionality for handling user home folders, relative file paths, browser URLs, and file manipulation methods such as `read/write_text()`, `read/write_bytes()`, and `glob()`. This addition brings enhanced, Pythonic ways to interact with Databricks Workspace paths, including creating and moving files, managing directories, and generating browser-accessible URIs. Additionally, the commit includes updates to existing methods and introduces new fixtures for creating notebooks, accompanied by extensive unit tests to ensure reliability and functionality.
* Added propagation of `blueprint` version into `User-Agent` header when it is used as library ([#114](https://github.com/databrickslabs/blueprint/issues/114)). A new feature has been introduced in the library that allows for the propagation of the `blueprint` version and the name of the command line interface (CLI) command used in the `User-Agent` header when the library is utilized as a library. This feature includes the addition of two new pairs of `OtherInfo`: `blueprint/X.Y.Z` to indicate that the request is made using the `blueprint` library and `cmd/<name>` to store the name of the CLI command used for making the request. The implementation involves using the `with_user_agent_extra` function from `databricks.sdk.config` to set the user agent consistently with the Databricks CLI. Several changes have been made to the test file for `test_useragent.py` to include a new test case, `test_user_agent_is_propagated`, which checks if the `blueprint` version and the name of the command are correctly propagated to the `User-Agent` header. A context manager `http_fixture_server` has been added that creates an HTTP server with a custom handler, which extracts the `blueprint` version and the command name from the `User-Agent` header and stores them in the `user_agent` dictionary. The test case calls the `foo` command with a mocked `WorkspaceClient` instance and sets the `DATABRICKS_HOST` and `DATABRICKS_TOKEN` environment variables to test the propagation of the `blueprint` version and the command name in the `User-Agent` header. The test case then asserts that the `blueprint` version and the name of the command are present and correctly set in the `user_agent` dictionary.
* Bump actions/checkout from 4.1.6 to 4.1.7 ([#112](https://github.com/databrickslabs/blueprint/issues/112)). In this release, the version of the "actions/checkout" action used in the `Checkout Code` step of the acceptance workflow has been updated from 4.1.6 to 4.1.7. This update may include bug fixes, performance improvements, and new features, although specific changes are not mentioned in the commit message. The `Unshallow` step remains unchanged, continuing to fetch and clean up the repository's history. This update ensures that the latest enhancements from the "actions/checkout" action are utilized, aiming to improve the reliability and performance of the code checkout process in the GitHub Actions workflow. Software engineers should be aware of this update and its potential impact on their workflows.

Dependency updates:

* Bump actions/checkout from 4.1.6 to 4.1.7 ([#112](https://github.com/databrickslabs/blueprint/pull/112)).

## 0.6.3

* fixed `Command.get_argument_type` bug with `UnionType` ([#110](https://github.com/databrickslabs/blueprint/issues/110)). In this release, the `Command.get_argument_type` method has been updated to include special handling for `UnionType`, resolving a bug that caused the function to crash when encountering this type. The method now returns the string representation of the annotation if the argument is a `UnionType`, providing more accurate and reliable results. To facilitate this, modifications were made using the `types` module. Additionally, the `foo` function has a new optional argument `optional_arg` of type `str`, with a default value of `None`. This argument is passed to the `some` function in the assertion. The `Prompts` type has been added to the `foo` function signature, and an assertion has been added to verify if `prompts` is an instance of `Prompts`. Lastly, the default value of the `address` argument has been changed from an empty string to "default", and the same changes have been applied to the `test_injects_prompts` test function.
Expand Down
2 changes: 1 addition & 1 deletion src/databricks/labs/blueprint/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.3"
__version__ = "0.7.0"

0 comments on commit c89ff4c

Please sign in to comment.