Skip to content

Release v0.11.1 #248

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Version changelog

## 0.11.1

* 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 available CPU count for concurrent processing, which is used to optimize parallel task execution. This method attempts to obtain the number of logical CPUs available for the process through various approaches, including using the `os` module's `process_cpu_count` attribute, the `sched_getaffinity` function on Linux systems, or the total number of CPUs in the system, with a default fallback to 1 if all else fails. The parallel task execution functionality has been updated to utilize this available CPU count method to automatically determine the number of threads to use when running tasks concurrently, unless a specific thread count is manually specified, allowing for more accurate and flexible concurrent processing, particularly in containerized environments with imposed CPU quotas.
* Improve support for reading text files that contain a Unicode BOM at the start ([#243](https://github.com/databrickslabs/blueprint/issues/243)). The library's text file reading functionality has been enhanced to handle Unicode Byte Order Mark (BOM) markers at the start of files, providing better support for reading local and Workspace files. New methods have been introduced to detect and handle BOM markers, including `_detect_encoding_bom` and `decode_with_bom`, which enable accurate detection of the encoding and decoding of text files. Additionally, the `_read_text_from_binary_io` and `read_text` methods have been added to read text from binary IO and file paths, respectively, taking into account BOM markers and non-seekable files. The existing `open` method has been updated to utilize the `decode_with_bom` method when opening files in text mode, allowing for improved handling of BOM markers and non-seekable files. The `read_text` function can handle various BOMs, including UTF-8, UTF-16 LE, UTF-16 BE, UTF-32 LE, and UTF-32 BE, and correctly decodes the text, while also supporting sized reads and raising a `ValueError` for non-seekable files when a size is specified.


## 0.11.0

* Marshalling: allow JSON-like fields ([#241](https://github.com/databrickslabs/blueprint/issues/241)). The library has undergone significant changes to improve its marshalling functionality, code readability, and maintainability. A new `JsonValue` type alias has been introduced to represent the maximum bounds of values that can be saved for an installation, and support for `Any` and `object` as type annotations on data classes has been removed. The library now issues a `DeprecationWarning` when saving raw `list` and `dict` fields, and raises a specific error during loading, instructing users to use `list[T]` or `dict[T]` instead. Various methods, including `_marshal_generic_list`, `_marshal_raw_list`, `_marshal_generic_dict`, and `_marshal_raw_dict`, have been updated to handle the serialization of lists and dictionaries, while the `_unmarshal` method now handles the deserialization of unions, lists, and dictionaries. Additionally, the library has been updated to provide more informative error messages, and several tests have been added to cover various scenarios, including generic dict and list JSON values, bool in union, and raw list and dict deprecation. The `Installation` class, `MockInstallation` class, and `Paths` class have also been updated with new methods, type hints, and custom initialization to improve code flexibility and maintainability.
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.11.0"
__version__ = "0.11.1"