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

Fixed missing widget name suffixes #243

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Fixed missing widget name suffixes #243

merged 1 commit into from
Jul 30, 2024

Conversation

nfx
Copy link
Collaborator

@nfx nfx commented Jul 30, 2024

No description provided.

@nfx nfx merged commit 9fb74ae into main Jul 30, 2024
7 of 8 checks passed
@nfx nfx deleted the fix/sfxs branch July 30, 2024 05:38
nfx added a commit that referenced this pull request Jul 30, 2024
* Fixed missing widget name suffixes ([#243](#243)). In this release, we have addressed an issue related to missing widget name suffixes ([#243](#243)) by adding a `_widget` suffix to the name of the widget object in the dashboards.py file. This change ensures consistency between the widget name and the id of the query, facilitating user understanding of the relationship between the two. A new method, _get_query_widget_spec, has also been added, although its specific functionality requires further investigation. Additionally, the unit tests in the `tests/unit/test_dashboards.py` file have been updated to check for the presence of the `_widget` suffix in widget names, ensuring that the tests accurately reflect the desired behavior. These changes improve the consistency of dashboard widget naming, thus benefiting software engineers utilizing or extending the project's widget-ordering functionalities.
@nfx nfx mentioned this pull request Jul 30, 2024
Copy link

❌ 35/36 passed, 3 flaky, 1 failed, 2 skipped, 10m20s total

❌ test_dashboards_creates_dashboard_with_replace_database: databricks.sdk.errors.platform.BadRequest: [INSUFFICIENT_PERMISSIONS] Insufficient privileges: (1.828s)
databricks.sdk.errors.platform.BadRequest: [INSUFFICIENT_PERMISSIONS] Insufficient privileges:
User does not have permission CREATE on CATALOG. SQLSTATE: 42501
05:38 DEBUG [databricks.sdk] Loaded from environment
05:38 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
05:38 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
05:38 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
05:38 INFO [databricks.sdk] Using Databricks Metadata Service authentication
[gw8] linux -- Python 3.10.14 /home/runner/work/lsql/lsql/.venv/bin/python
05:38 DEBUG [databricks.sdk] Loaded from environment
05:38 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
05:38 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
05:38 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
05:38 INFO [databricks.sdk] Using Databricks Metadata Service authentication
05:38 DEBUG [databricks.sdk] POST /api/2.0/lakeview/dashboards
> {
>   "display_name": "created_by_lsql_JFV8bOd1gb3Zr42T"
> }
< 200 OK
< {
<   "create_time": "2024-07-30T05:38:21.281Z",
<   "dashboard_id": "01ef4e35ee7717a88364bd5de44fbaea",
<   "display_name": "created_by_lsql_JFV8bOd1gb3Zr42T",
<   "etag": "-1013369268",
<   "lifecycle_state": "ACTIVE",
<   "parent_path": "/Users/4106dc97-a963-48f0-a079-a578238959a6",
<   "path": "/Users/4106dc97-a963-48f0-a079-a578238959a6/created_by_lsql_JFV8bOd1gb3Zr42T.lvdash.json",
<   "serialized_dashboard": "{\"pages\":[{\"name\":\"b53e7b8f\",\"displayName\":\"New Page\"}]}",
<   "update_time": "2024-07-30T05:38:21.469Z"
< }
05:38 DEBUG [databricks.labs.lsql.backends] [api][execute] CREATE SCHEMA hive_metastore.lsql_sk3gk WITH DBPROPERTIES (RemoveAfter=2024073006)
05:38 DEBUG [databricks.labs.lsql.core] Executing SQL statement: CREATE SCHEMA hive_metastore.lsql_sk3gk WITH DBPROPERTIES (RemoveAfter=2024073006)
05:38 DEBUG [databricks.sdk] POST /api/2.0/sql/statements/
> {
>   "format": "JSON_ARRAY",
>   "statement": "CREATE SCHEMA hive_metastore.lsql_sk3gk WITH DBPROPERTIES (RemoveAfter=2024073006)",
>   "warehouse_id": "TEST_DEFAULT_WAREHOUSE_ID"
> }
< 200 OK
< {
<   "statement_id": "01ef4e35-eeb7-134e-b9b6-c575aea1e2c4",
<   "status": {
<     "error": {
<       "error_code": "BAD_REQUEST",
<       "message": "[INSUFFICIENT_PERMISSIONS] Insufficient privileges:\nUser does not have permission CREATE on CATA... (20 more bytes)"
<     },
<     "state": "FAILED"
<   }
< }
05:38 DEBUG [databricks.sdk] Loaded from environment
05:38 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
05:38 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
05:38 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
05:38 INFO [databricks.sdk] Using Databricks Metadata Service authentication
05:38 DEBUG [databricks.sdk] POST /api/2.0/lakeview/dashboards
> {
>   "display_name": "created_by_lsql_JFV8bOd1gb3Zr42T"
> }
< 200 OK
< {
<   "create_time": "2024-07-30T05:38:21.281Z",
<   "dashboard_id": "01ef4e35ee7717a88364bd5de44fbaea",
<   "display_name": "created_by_lsql_JFV8bOd1gb3Zr42T",
<   "etag": "-1013369268",
<   "lifecycle_state": "ACTIVE",
<   "parent_path": "/Users/4106dc97-a963-48f0-a079-a578238959a6",
<   "path": "/Users/4106dc97-a963-48f0-a079-a578238959a6/created_by_lsql_JFV8bOd1gb3Zr42T.lvdash.json",
<   "serialized_dashboard": "{\"pages\":[{\"name\":\"b53e7b8f\",\"displayName\":\"New Page\"}]}",
<   "update_time": "2024-07-30T05:38:21.469Z"
< }
05:38 DEBUG [databricks.labs.lsql.backends] [api][execute] CREATE SCHEMA hive_metastore.lsql_sk3gk WITH DBPROPERTIES (RemoveAfter=2024073006)
05:38 DEBUG [databricks.labs.lsql.core] Executing SQL statement: CREATE SCHEMA hive_metastore.lsql_sk3gk WITH DBPROPERTIES (RemoveAfter=2024073006)
05:38 DEBUG [databricks.sdk] POST /api/2.0/sql/statements/
> {
>   "format": "JSON_ARRAY",
>   "statement": "CREATE SCHEMA hive_metastore.lsql_sk3gk WITH DBPROPERTIES (RemoveAfter=2024073006)",
>   "warehouse_id": "TEST_DEFAULT_WAREHOUSE_ID"
> }
< 200 OK
< {
<   "statement_id": "01ef4e35-eeb7-134e-b9b6-c575aea1e2c4",
<   "status": {
<     "error": {
<       "error_code": "BAD_REQUEST",
<       "message": "[INSUFFICIENT_PERMISSIONS] Insufficient privileges:\nUser does not have permission CREATE on CATA... (20 more bytes)"
<     },
<     "state": "FAILED"
<   }
< }
05:38 DEBUG [databricks.sdk] DELETE /api/2.0/lakeview/dashboards/01ef4e35ee7717a88364bd5de44fbaea
< 200 OK
< {}
[gw8] linux -- Python 3.10.14 /home/runner/work/lsql/lsql/.venv/bin/python

Flaky tests:

  • 🤪 test_dashboards_creates_dashboard_with_order_overwrite_in_dashboard_yaml (9.674s)
  • 🤪 test_dashboard_deploys_dashboard_with_big_widget (11.505s)
  • 🤪 test_dashboard_deploys_dashboard_the_same_as_created_dashboard (11.704s)

Running from acceptance #344

nfx added a commit that referenced this pull request Jul 30, 2024
* Fixed missing widget name suffixes
([#243](#243)). In this
release, we have addressed an issue related to missing widget name
suffixes ([#243](#243)) by
adding a `_widget` suffix to the name of the widget object in the
dashboards.py file. This change ensures consistency between the widget
name and the id of the query, facilitating user understanding of the
relationship between the two. A new method, _get_query_widget_spec, has
also been added, although its specific functionality requires further
investigation. Additionally, the unit tests in the
`tests/unit/test_dashboards.py` file have been updated to check for the
presence of the `_widget` suffix in widget names, ensuring that the
tests accurately reflect the desired behavior. These changes improve the
consistency of dashboard widget naming, thus benefiting software
engineers utilizing or extending the project's widget-ordering
functionalities.
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.

1 participant