databricks / databricks-sdk-go

Databricks SDK for Go
https://docs.databricks.com/dev-tools/sdk-go.html
Apache License 2.0
51 stars 42 forks source link

lakeview publish --embed-credentials default option configured to true whereas should be false #1002

Open pratikk-databricks opened 3 months ago

pratikk-databricks commented 3 months ago

Describe the issue

the databricks lakeview publish command has a flag --embed-credentials which is a boolean flag. So if the --embed-credentials is present then it should be True or else False. Although in the current version, if we do not specify the --embed-credentials, by default the dashboard is published with embed-credentials true. So there is no way to specify it as false with the current cli command

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. Run databricks lakeview publish <Dashboard ID> --warehouse id <warehouse_id> The reports gets published with embedded credentials

  2. Run databricks lakeview publish <Dashboard ID> --warehouse id <warehouse_id> --embed-credentials The reports gets published with embedded credentials

  3. Run databricks lakeview publish <Dashboard ID> --warehouse id <warehouse_id> --embed-credentials false does not work since --embed-credentials is a boolean flag

Expected Behavior

The command without the --embed-credentials flag should publish the dashboard with in "Don't embeded Credentials' mode: databricks lakeview publish --warehouse id

Actual Behavior

  1. Run databricks lakeview publish <Dashboard ID> --warehouse id <warehouse_id> The reports gets published with embedded credentials

  2. Run databricks lakeview publish <Dashboard ID> --warehouse id <warehouse_id> --embed-credentials The reports gets published with embedded credentials

No option to publish without embedded credentials mode

OS and CLI version

Windows, v0.218.1

Is this a regression?

Did this work in a previous version of the CLI? If so, which versions did you try? Not tried in a previous version

Debug Logs

Nothing much in debug logs as there is no error.

andrewnester commented 3 months ago

Hi! The design principal for CLI is to mirror / follow API behaviour

For 1 - Works as expected, since this is a default value for an API hence the behaviour (https://docs.databricks.com/api/workspace/lakeview/publish#embed_credentials)

For 2 - Works as expected

For 3 - you can call it databricks lakeview publish <ID> --embed-credentials=false but indeed there's an issue there - false value seems to be dropped from the request.

This is an issue on OpenAPI / Go SDK side, so I move the issue to that repo