Skip to content
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

adding normalize-case option to databricks labs lsql fmt cmd #254

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

HariGS-DB
Copy link
Contributor

databricks labs lsql fmt cmd be defaults normalizes the query to lower case. Some queries are case sensitive
(ex UCX dashboard using map field keys)
This PR adds a parameter normalize-case to the fmt cli cmd to allow user to not normalize the query text (default would be to normalize as before)

Resolves #253

Copy link

✅ 34/34 passed, 2 flaky, 3 skipped, 46m54s total

Flaky tests:

  • 🤪 test_dashboard_deploys_dashboard_with_display_name (9.401s)
  • 🤪 test_dashboard_deploys_dashboard_with_big_widget (8.506s)

Running from acceptance #354

Copy link
Collaborator

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nfx nfx merged commit 0a9fd91 into main Aug 24, 2024
8 checks passed
@nfx nfx deleted the feat/query_case branch August 24, 2024 07:59
nfx added a commit that referenced this pull request Aug 26, 2024
* Added design for filter file ([#251](#251)). A new feature has been added to enable the creation of filters for multiple widgets in a dashboard using a `.filter.json` file. This file allows users to specify columns to be filtered, the filter type, title, description, order, and a unique ID for each filter. Both the `column` and `columns` flags are supported, with the former taking a single string and the latter taking a list of strings. The filter type can be set to a drop-down menu or another type as desired. The `.filter.json` file schema also supports optional `title` and `description` strings, as well as `order` and `ID` flags. An example of a `.filter.json` file is provided in the commit message. Additionally, the `dashboard.yml` file documentation has been updated to include information on how to use the new `.filter.json` file.
* adding normalize-case option to databricks labs lsql fmt cmd ([#254](#254)). In this open-source library release, the `databricks labs lsql` tool's `fmt` command now supports a new flag, `normalize-case`. This flag allows users to control the normalization of query text to lowercase, providing more flexibility when formatting SQL queries. By default, query text is still normalized to lowercase, but users can now prevent this behavior by setting the `normalize-case` flag to `False`. This change addresses an issue where some queries are case sensitive, such as those using map field keys in UCX dashboards. Additionally, a new parameter `normalize_case` has been added to the `format` method in the `dashboards.py` file, with updated method documentation. A new test function, `test_query_formats_no_normalize()`, has also been included to ensure consistent formatter behavior.
@nfx nfx mentioned this pull request Aug 26, 2024
nfx added a commit that referenced this pull request Aug 26, 2024
* Added design for filter file
([#251](#251)). A new
feature has been added to enable the creation of filters for multiple
widgets in a dashboard using a `.filter.json` file. This file allows
users to specify columns to be filtered, the filter type, title,
description, order, and a unique ID for each filter. Both the `column`
and `columns` flags are supported, with the former taking a single
string and the latter taking a list of strings. The filter type can be
set to a drop-down menu or another type as desired. The `.filter.json`
file schema also supports optional `title` and `description` strings, as
well as `order` and `ID` flags. An example of a `.filter.json` file is
provided in the commit message. Additionally, the `dashboard.yml` file
documentation has been updated to include information on how to use the
new `.filter.json` file.
* adding normalize-case option to databricks labs lsql fmt cmd
([#254](#254)). In this
open-source library release, the `databricks labs lsql` tool's `fmt`
command now supports a new flag, `normalize-case`. This flag allows
users to control the normalization of query text to lowercase, providing
more flexibility when formatting SQL queries. By default, query text is
still normalized to lowercase, but users can now prevent this behavior
by setting the `normalize-case` flag to `False`. This change addresses
an issue where some queries are case sensitive, such as those using map
field keys in UCX dashboards. Additionally, a new parameter
`normalize_case` has been added to the `format` method in the
`dashboards.py` file, with updated method documentation. A new test
function, `test_query_formats_no_normalize()`, has also been included to
ensure consistent formatter behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add option to not lower case sql when running lsql fmt
2 participants