Skip to content

Commit

Permalink
Release v0.6.0 (#217)
Browse files Browse the repository at this point in the history
* Added method to dashboards to get dashboard url
([#211](#211)). In this
release, we have added a new method `get_url` to the
`lakeview_dashboards` object in the `laksedashboard` library. This
method utilizes the Databricks SDK to retrieve the dashboard URL,
simplifying the code and making it more maintainable. Previously, the
dashboard URL was constructed by concatenating the host and dashboard
ID, but this new method ensures that the URL is obtained correctly, even
if the format changes in the future. Additionally, a new unit test has
been added for a method that gets the dashboard URL using the workspace
client. This new functionality allows users to easily retrieve the URL
for a dashboard using its ID and the workspace client.
* Extend replace database in query
([#210](#210)). This commit
extends the database replacement functionality in the
`DashboardMetadata` class, allowing users to specify which database and
catalog to replace. The enhancement includes support for catalog
replacement and a new `replace_database` method in the
`DashboardMetadata` class, which replaces the catalog and/or database in
the query based on provided parameters. These changes enhance the
flexibility and customization of the database replacement feature in
queries, making it easier for users to control how their data is
displayed in the dashboard. The `create_dashboard` function has also
been updated to use the new method for replacing the database and
catalog. Additionally, the `TileMetadata` update method has been
replaced with a new merge method, and the `QueryTile` and `Tile` classes
have new properties and methods for handling content, width, height, and
position. The commit also includes several unit tests to ensure the new
functionality works as expected.
* Improve object oriented dashboard-as-code implementation
([#208](#208)). In this
release, the object-oriented implementation of the dashboard-as-code
feature has been significantly improved, addressing previous pull
request comments
([#201](#201)). The
`TileMetadata` dataclass now includes methods for updating and comparing
tile metadata, and the `DashboardMetadata` class has been removed and
its functionality incorporated into the `Dashboards` class. The
`Dashboards` class now generates tiles, datasets, and layouts for
dashboards using the provided `query_transformer`. The code's
readability and maintainability have been further enhanced by replacing
the use of the `copy` module with `dataclasses.replace` for creating
object copies. Additionally, updates have been made to the unit tests
for dashboard functionality in the project, with new methods and
attributes added to check for valid dashboard metadata and handle
duplicate query or widget IDs, as well as to specify the order in which
tiles and widgets should be displayed in the dashboard.
  • Loading branch information
nfx authored Jul 11, 2024
1 parent f86d823 commit 2c062b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Version changelog

## 0.6.0

* Added method to dashboards to get dashboard url ([#211](https://github.com/databrickslabs/lsql/issues/211)). In this release, we have added a new method `get_url` to the `lakeview_dashboards` object in the `laksedashboard` library. This method utilizes the Databricks SDK to retrieve the dashboard URL, simplifying the code and making it more maintainable. Previously, the dashboard URL was constructed by concatenating the host and dashboard ID, but this new method ensures that the URL is obtained correctly, even if the format changes in the future. Additionally, a new unit test has been added for a method that gets the dashboard URL using the workspace client. This new functionality allows users to easily retrieve the URL for a dashboard using its ID and the workspace client.
* Extend replace database in query ([#210](https://github.com/databrickslabs/lsql/issues/210)). This commit extends the database replacement functionality in the `DashboardMetadata` class, allowing users to specify which database and catalog to replace. The enhancement includes support for catalog replacement and a new `replace_database` method in the `DashboardMetadata` class, which replaces the catalog and/or database in the query based on provided parameters. These changes enhance the flexibility and customization of the database replacement feature in queries, making it easier for users to control how their data is displayed in the dashboard. The `create_dashboard` function has also been updated to use the new method for replacing the database and catalog. Additionally, the `TileMetadata` update method has been replaced with a new merge method, and the `QueryTile` and `Tile` classes have new properties and methods for handling content, width, height, and position. The commit also includes several unit tests to ensure the new functionality works as expected.
* Improve object oriented dashboard-as-code implementation ([#208](https://github.com/databrickslabs/lsql/issues/208)). In this release, the object-oriented implementation of the dashboard-as-code feature has been significantly improved, addressing previous pull request comments ([#201](https://github.com/databrickslabs/lsql/issues/201)). The `TileMetadata` dataclass now includes methods for updating and comparing tile metadata, and the `DashboardMetadata` class has been removed and its functionality incorporated into the `Dashboards` class. The `Dashboards` class now generates tiles, datasets, and layouts for dashboards using the provided `query_transformer`. The code's readability and maintainability have been further enhanced by replacing the use of the `copy` module with `dataclasses.replace` for creating object copies. Additionally, updates have been made to the unit tests for dashboard functionality in the project, with new methods and attributes added to check for valid dashboard metadata and handle duplicate query or widget IDs, as well as to specify the order in which tiles and widgets should be displayed in the dashboard.


## 0.5.0

* Added Command Execution backend which uses Command Execution API on a cluster ([#95](https://github.com/databrickslabs/lsql/issues/95)). In this release, the databricks labs lSQL library has been updated with a new Command Execution backend that utilizes the Command Execution API. A new `CommandExecutionBackend` class has been implemented, which initializes a `CommandExecutor` instance taking a cluster ID, workspace client, and language as parameters. The `execute` method runs SQL commands on the specified cluster, and the `fetch` method returns the query result as an iterator of Row objects. The existing `StatementExecutionBackend` class has been updated to inherit from a new abstract base class called `ExecutionBackend`, which includes a `save_table` method for saving data to tables and is meant to be a common base class for both Statement and Command Execution backends. The `StatementExecutionBackend` class has also been updated to use the new `ExecutionBackend` abstract class and its constructor now accepts a `max_records_per_batch` parameter. The `execute` and `fetch` methods have been updated to use the new `_only_n_bytes` method for logging truncated SQL statements. Additionally, the `CommandExecutionBackend` class has several methods, `execute`, `fetch`, and `save_table` to execute commands on a cluster and save the results to tables in the databricks workspace. This new backend is intended to be used for executing commands on a cluster and saving the results in a databricks workspace.
Expand Down
2 changes: 1 addition & 1 deletion src/databricks/labs/lsql/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.0"
__version__ = "0.6.0"

0 comments on commit 2c062b2

Please sign in to comment.