Skip to content

Conversation

@nfx
Copy link
Collaborator

@nfx nfx commented Jul 30, 2024

No description provided.

@github-actions
Copy link

❌ 35/36 passed, 1 failed, 2 skipped, 55m20s total

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

Running from acceptance #342

@nfx nfx merged commit 22e1daf into main Jul 30, 2024
@nfx nfx deleted the fix/unique-names branch July 30, 2024 05:14
nfx added a commit that referenced this pull request Jul 30, 2024
* Fixed dataset/widget name uniqueness requirement that was preventing dashboards being deployed ([#241](#241)). A fix has been implemented to address a uniqueness requirement issue with the dataset/widget name that was preventing dashboard deployment. A new `widget` instance is now created with a unique name, generated by appending `_widget` to the metadata ID, in the `get_layouts` method. This ensures that multiple widgets with the same ID but different content can exist in a single dashboard, thereby meeting the name uniqueness requirement. In the `save_to_folder` method, the widget name is modified by removing the `_widget` suffix before writing the textbox specification to a markdown file, maintaining consistency between the widget ID and file name. These changes are localized to the `get_layouts` and `save_to_folder` methods, and no new methods have been added. The existing functionality related to the creation, validation, and saving of dashboard layouts remains unaltered.
@nfx nfx mentioned this pull request Jul 30, 2024
nfx added a commit that referenced this pull request Jul 30, 2024
* Fixed dataset/widget name uniqueness requirement that was preventing
dashboards being deployed
([#241](#241)). A fix has
been implemented to address a uniqueness requirement issue with the
dataset/widget name that was preventing dashboard deployment. A new
`widget` instance is now created with a unique name, generated by
appending `_widget` to the metadata ID, in the `get_layouts` method.
This ensures that multiple widgets with the same ID but different
content can exist in a single dashboard, thereby meeting the name
uniqueness requirement. In the `save_to_folder` method, the widget name
is modified by removing the `_widget` suffix before writing the textbox
specification to a markdown file, maintaining consistency between the
widget ID and file name. These changes are localized to the
`get_layouts` and `save_to_folder` methods, and no new methods have been
added. The existing functionality related to the creation, validation,
and saving of dashboard layouts remains unaltered.
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.

2 participants