diff --git a/CHANGELOG.md b/CHANGELOG.md index 7303a79..d8ddad1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Version changelog +## 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. + + ## 0.6.2 * Applied type casting & remove empty kwarg for Command ([#108](https://github.com/databrickslabs/blueprint/issues/108)). A new method, `get_argument_type`, has been added to the `Command` class in the `cli.py` file to determine the type of a given argument name based on the function's signature. The `_route` method has been updated to remove any empty keyword arguments from the `kwargs` dictionary, and apply type casting based on the argument type using the `get_argument_type` method. This ensures that the `kwargs` passed into `App.command` are correctly typed and eliminates any empty keyword arguments, which were previously passed as empty strings. In the test file for the command-line interface, the `foo` command's keyword arguments have been updated to include `age` (int), `salary` (float), `is_customer` (bool), and `address` (str) types, with the `name` argument remaining and a default value for `address`. The `test_commands` and `test_injects_prompts` functions have been updated accordingly. These changes aim to improve the input validation and type safety of the `App.command` method. diff --git a/src/databricks/labs/blueprint/__about__.py b/src/databricks/labs/blueprint/__about__.py index 22049ab..63af887 100644 --- a/src/databricks/labs/blueprint/__about__.py +++ b/src/databricks/labs/blueprint/__about__.py @@ -1 +1 @@ -__version__ = "0.6.2" +__version__ = "0.6.3"