Fix dashboard serialisation: query is now queryLines on upstream REST API#491
Fix dashboard serialisation: query is now queryLines on upstream REST API#491
query is now queryLines on upstream REST API#491Conversation
Serialized dashboards now return the query as an array of lines in the `queryLines` attribute.
This was previously missing.
|
❌ 36/37 passed, 1 failed, 4 skipped, 4m32s total ❌ test_runtime_backend_errors_handled[\nfrom databricks.labs.lsql.backends import RuntimeBackend\nfrom databricks.sdk.errors import Unknown\nbackend = RuntimeBackend()\ntry:\n grants = backend.fetch("SHOW GRANTS ON METASTORE")\n print("FAILED")\nexcept Unknown:\n print("PASSED")\n]: ValueError: TEST_SCHEMA auth: metadata-service: HTTPConnectionPool(host='127.0.0.1', port=33719): Read timed out. (read timeout=10). Config: host=https://DATABRICKS_HOST, CLOUD_ENV_client_id=4106dc97-a963-48f0-a079-a578238959a6, CLOUD_ENV_tenant_id=9f37a392-f0ae-4280-9796-f1864a10effc, auth_type=metadata-service, cluster_id=DATABRICKS_CLUSTER_ID, warehouse_id=DATABRICKS_WAREHOUSE_ID, metadata_service_url=***. Env: DATABRICKS_HOST, ARM_CLIENT_ID, ARM_TENANT_ID, DATABRICKS_AUTH_TYPE, DATABRICKS_CLUSTER_ID, DATABRICKS_WAREHOUSE_ID, DATABRICKS_METADATA_SERVICE_URL (10.003s)Running from acceptance #552 |
Hatch 1.9.4 does not work with the current version of pip.
3203f37 to
5756001
Compare
This is a test that is failing on |
This PR updates the way we load datasets from dashboards via the API:
queryattribute in the response, whereas now it returnsqueryLinescontaining an array of the query lines.queryfor compatibility when writing, but converts it toqueryLineson fetch.For compatibility this change retains the use of
query(formatted via SQLGlot) in the saved dashboards.An integration test has been added to cover
.save_to_folder(): this was previously missing but there was no integration test.Related issues:
test_dashboards_creates_exported_dashboard_definition#415test_dashboard_deploys_dashboard_the_same_as_created_dashboard#416As an incidental change, Hatch is upgraded from 1.9.4 to 1.16.5: this is necessary because 1.9.4 no longer works, and without Hatch the CI/CD cannot run.