2024-02-13 14:33:59 +00:00
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
2024-05-22 07:41:32 +00:00
package quality_monitors
2024-02-13 14:33:59 +00:00
import (
"fmt"
"github.com/databricks/cli/cmd/root"
"github.com/databricks/cli/libs/cmdio"
"github.com/databricks/cli/libs/flags"
"github.com/databricks/databricks-sdk-go/service/catalog"
"github.com/spf13/cobra"
)
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var cmdOverrides [ ] func ( * cobra . Command )
func New ( ) * cobra . Command {
cmd := & cobra . Command {
2024-05-22 07:41:32 +00:00
Use : "quality-monitors" ,
2024-02-13 14:33:59 +00:00
Short : ` A monitor computes and monitors data or model quality metrics for a table over time. ` ,
Long : ` A monitor computes and monitors data or model quality metrics for a table over
time . It generates metrics tables and a dashboard that you can use to monitor
table health and set alerts .
Most write operations require the user to be the owner of the table ( or its
parent schema or parent catalog ) . Viewing the dashboard , computed metrics , or
monitor configuration only requires the user to have * * SELECT * * privileges on
the table ( along with * * USE_SCHEMA * * and * * USE_CATALOG * * ) . ` ,
GroupID : "catalog" ,
Annotations : map [ string ] string {
"package" : "catalog" ,
} ,
}
2024-03-06 09:53:44 +00:00
// Add methods
cmd . AddCommand ( newCancelRefresh ( ) )
cmd . AddCommand ( newCreate ( ) )
cmd . AddCommand ( newDelete ( ) )
cmd . AddCommand ( newGet ( ) )
cmd . AddCommand ( newGetRefresh ( ) )
cmd . AddCommand ( newListRefreshes ( ) )
Bump github.com/databricks/databricks-sdk-go from 0.45.0 to 0.46.0 (#1760)
Bumps
[github.com/databricks/databricks-sdk-go](https://github.com/databricks/databricks-sdk-go)
from 0.45.0 to 0.46.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/databricks/databricks-sdk-go/releases">github.com/databricks/databricks-sdk-go's
releases</a>.</em></p>
<blockquote>
<h2>v0.46.0</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Fail fast when authenticating if host is not configured (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1033">#1033</a>).</li>
<li>Improve non-JSON error handling (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1031">#1031</a>).</li>
</ul>
<h3>Internal Changes</h3>
<ul>
<li>Add TestAccCreateOboTokenOnAws to flaky test list (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1029">#1029</a>).</li>
<li>Add workflows manage integration tests checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1032">#1032</a>).</li>
<li>Fix TestMwsAccWorkspaces cleanup (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1028">#1028</a>).</li>
<li>Improve integration test comment (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1035">#1035</a>).</li>
<li>Temporary ignore Metastore test failures (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1027">#1027</a>).</li>
<li>Update test to support new accounts (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1026">#1026</a>).</li>
<li>Use statuses instead of checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1036">#1036</a>).</li>
</ul>
<h3>API Changes:</h3>
<ul>
<li>Added <code>RegenerateDashboard</code> method for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#QualityMonitorsAPI">w.QualityMonitors</a>
workspace-level service.</li>
<li>Added <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RegenerateDashboardRequest">catalog.RegenerateDashboardRequest</a>
and <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RegenerateDashboardResponse">catalog.RegenerateDashboardResponse</a>.</li>
<li>Added <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#QueueDetails">jobs.QueueDetails</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#QueueDetailsCodeCode">jobs.QueueDetailsCodeCode</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunLifecycleStateV2State">jobs.RunLifecycleStateV2State</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunStatus">jobs.RunStatus</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationCodeCode">jobs.TerminationCodeCode</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationDetails">jobs.TerminationDetails</a>
and <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationTypeType">jobs.TerminationTypeType</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#BaseRun">jobs.BaseRun</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RepairHistoryItem">jobs.RepairHistoryItem</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Run">jobs.Run</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunTask">jobs.RunTask</a>.</li>
<li>Added <code>MaxProvisionedThroughput</code> and
<code>MinProvisionedThroughput</code> fields for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServedModelInput">serving.ServedModelInput</a>.</li>
<li>Added <code>ColumnsToSync</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/vectorsearch#DeltaSyncVectorIndexSpecRequest">vectorsearch.DeltaSyncVectorIndexSpecRequest</a>.</li>
<li>Changed <code>WorkloadSize</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServedModelInput">serving.ServedModelInput</a>
to no longer be required.</li>
</ul>
<p>OpenAPI SHA: d05898328669a3f8ab0c2ecee37db2673d3ea3f7, Date:
2024-09-04</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/databricks/databricks-sdk-go/blob/main/CHANGELOG.md">github.com/databricks/databricks-sdk-go's
changelog</a>.</em></p>
<blockquote>
<h2>[Release] Release v0.46.0</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Fail fast when authenticating if host is not configured (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1033">#1033</a>).</li>
<li>Improve non-JSON error handling (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1031">#1031</a>).</li>
</ul>
<h3>Internal Changes</h3>
<ul>
<li>Add TestAccCreateOboTokenOnAws to flaky test list (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1029">#1029</a>).</li>
<li>Add workflows manage integration tests checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1032">#1032</a>).</li>
<li>Fix TestMwsAccWorkspaces cleanup (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1028">#1028</a>).</li>
<li>Improve integration test comment (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1035">#1035</a>).</li>
<li>Temporary ignore Metastore test failures (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1027">#1027</a>).</li>
<li>Update test to support new accounts (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1026">#1026</a>).</li>
<li>Use statuses instead of checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1036">#1036</a>).</li>
</ul>
<h3>API Changes:</h3>
<ul>
<li>Added <code>RegenerateDashboard</code> method for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#QualityMonitorsAPI">w.QualityMonitors</a>
workspace-level service.</li>
<li>Added <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RegenerateDashboardRequest">catalog.RegenerateDashboardRequest</a>
and <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RegenerateDashboardResponse">catalog.RegenerateDashboardResponse</a>.</li>
<li>Added <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#QueueDetails">jobs.QueueDetails</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#QueueDetailsCodeCode">jobs.QueueDetailsCodeCode</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunLifecycleStateV2State">jobs.RunLifecycleStateV2State</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunStatus">jobs.RunStatus</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationCodeCode">jobs.TerminationCodeCode</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationDetails">jobs.TerminationDetails</a>
and <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationTypeType">jobs.TerminationTypeType</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#BaseRun">jobs.BaseRun</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RepairHistoryItem">jobs.RepairHistoryItem</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Run">jobs.Run</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunTask">jobs.RunTask</a>.</li>
<li>Added <code>MaxProvisionedThroughput</code> and
<code>MinProvisionedThroughput</code> fields for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServedModelInput">serving.ServedModelInput</a>.</li>
<li>Added <code>ColumnsToSync</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/vectorsearch#DeltaSyncVectorIndexSpecRequest">vectorsearch.DeltaSyncVectorIndexSpecRequest</a>.</li>
<li>Changed <code>WorkloadSize</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServedModelInput">serving.ServedModelInput</a>
to no longer be required.</li>
</ul>
<p>OpenAPI SHA: d05898328669a3f8ab0c2ecee37db2673d3ea3f7, Date:
2024-09-04</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/37cb031019b9cbe7e7388e6a14bcc6e54bbc13b5"><code>37cb031</code></a>
[Release] Release v0.46.0 (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1037">#1037</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/34f37f9e4cb179d854cde5796485932e538d8543"><code>34f37f9</code></a>
[Internal] Use statuses instead of checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1036">#1036</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/590d59704619647b958eec09f8faf9fa952ddd86"><code>590d597</code></a>
[Internal] Improve integration test comment (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1035">#1035</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/6ab81eed7850f16acb75e01fdd32193ea4b949cc"><code>6ab81ee</code></a>
[Internal] Add workflows manage integration tests checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1032">#1032</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/4886afe31293dddc1c26165faa057a9ed84e1f6d"><code>4886afe</code></a>
[Fix] Fail fast when authenticating if host is not configured (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1033">#1033</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/796dae1674b8ea1485e9c07b509f2bdc7a432c25"><code>796dae1</code></a>
[Fix] Handle non-JSON errors (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1031">#1031</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/a24a158b34b9bd0442e91450b3a599835558b612"><code>a24a158</code></a>
[Internal] Add TestAccCreateOboTokenOnAws to flaky test list (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1029">#1029</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/9ab8b42bc4694a4066ac22021e4ccde2da6f3d5f"><code>9ab8b42</code></a>
[Fix] Fix TestMwsAccWorkspaces cleanup (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1028">#1028</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/cc22621c96ed52279bdb41eb5ab78d03484bbdd0"><code>cc22621</code></a>
[Internal] Temporary ignore Metastore test failures (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1027">#1027</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/8dbaaf2767ea79b619196f5e71c02793f8e75b24"><code>8dbaaf2</code></a>
[Fix] Update test to support new accounts (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1026">#1026</a>)</li>
<li>See full diff in <a
href="https://github.com/databricks/databricks-sdk-go/compare/v0.45.0...v0.46.0">compare
view</a></li>
</ul>
</details>
<br />
<details>
<summary>Most Recent Ignore Conditions Applied to This Pull
Request</summary>
| Dependency Name | Ignore Conditions |
| --- | --- |
| github.com/databricks/databricks-sdk-go | [>= 0.28.a, < 0.29] |
</details>
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/databricks/databricks-sdk-go&package-manager=go_modules&previous-version=0.45.0&new-version=0.46.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nester <andrew.nester@databricks.com>
2024-09-09 14:49:39 +00:00
cmd . AddCommand ( newRegenerateDashboard ( ) )
2024-03-06 09:53:44 +00:00
cmd . AddCommand ( newRunRefresh ( ) )
cmd . AddCommand ( newUpdate ( ) )
2024-02-13 14:33:59 +00:00
// Apply optional overrides to this command.
for _ , fn := range cmdOverrides {
fn ( cmd )
}
return cmd
}
2024-02-15 14:52:17 +00:00
// start cancel-refresh command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var cancelRefreshOverrides [ ] func (
* cobra . Command ,
* catalog . CancelRefreshRequest ,
)
func newCancelRefresh ( ) * cobra . Command {
cmd := & cobra . Command { }
var cancelRefreshReq catalog . CancelRefreshRequest
// TODO: short flags
2024-04-16 12:03:21 +00:00
cmd . Use = "cancel-refresh TABLE_NAME REFRESH_ID"
2024-02-15 14:52:17 +00:00
cmd . Short = ` Cancel refresh. `
cmd . Long = ` Cancel refresh .
Cancel an active monitor refresh for the given refresh ID .
The caller must either : 1. be an owner of the table ' s parent catalog 2. have
* * USE_CATALOG * * on the table ' s parent catalog and be an owner of the table ' s
parent schema 3. have the following permissions : - * * USE_CATALOG * * on the
table ' s parent catalog - * * USE_SCHEMA * * on the table ' s parent schema - be an
owner of the table
Additionally , the call must be made from the workspace where the monitor was
created .
Arguments :
2024-04-16 12:03:21 +00:00
TABLE_NAME : Full name of the table .
2024-02-15 14:52:17 +00:00
REFRESH_ID : ID of the refresh . `
// This command is being previewed; hide from help output.
cmd . Hidden = true
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
2024-03-12 14:12:34 +00:00
check := root . ExactArgs ( 2 )
2024-02-15 14:52:17 +00:00
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
2024-04-16 12:03:21 +00:00
cancelRefreshReq . TableName = args [ 0 ]
2024-02-15 14:52:17 +00:00
cancelRefreshReq . RefreshId = args [ 1 ]
2024-05-22 07:41:32 +00:00
err = w . QualityMonitors . CancelRefresh ( ctx , cancelRefreshReq )
2024-02-15 14:52:17 +00:00
if err != nil {
return err
}
return nil
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range cancelRefreshOverrides {
fn ( cmd , & cancelRefreshReq )
}
return cmd
}
2024-02-13 14:33:59 +00:00
// start create command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var createOverrides [ ] func (
* cobra . Command ,
* catalog . CreateMonitor ,
)
func newCreate ( ) * cobra . Command {
cmd := & cobra . Command { }
var createReq catalog . CreateMonitor
var createJson flags . JsonFlag
// TODO: short flags
cmd . Flags ( ) . Var ( & createJson , "json" , ` either inline JSON string or @path/to/file.json with request body ` )
cmd . Flags ( ) . StringVar ( & createReq . BaselineTableName , "baseline-table-name" , createReq . BaselineTableName , ` Name of the baseline table from which drift metrics are computed from. ` )
// TODO: array: custom_metrics
// TODO: complex arg: data_classification_config
// TODO: complex arg: inference_log
2024-03-20 13:57:53 +00:00
// TODO: complex arg: notifications
2024-02-13 14:33:59 +00:00
// TODO: complex arg: schedule
cmd . Flags ( ) . BoolVar ( & createReq . SkipBuiltinDashboard , "skip-builtin-dashboard" , createReq . SkipBuiltinDashboard , ` Whether to skip creating a default dashboard summarizing data quality metrics. ` )
// TODO: array: slicing_exprs
2024-03-20 13:57:53 +00:00
// TODO: complex arg: snapshot
2024-02-13 14:33:59 +00:00
// TODO: complex arg: time_series
cmd . Flags ( ) . StringVar ( & createReq . WarehouseId , "warehouse-id" , createReq . WarehouseId , ` Optional argument to specify the warehouse for dashboard creation. ` )
2024-04-16 12:03:21 +00:00
cmd . Use = "create TABLE_NAME ASSETS_DIR OUTPUT_SCHEMA_NAME"
2024-02-13 14:33:59 +00:00
cmd . Short = ` Create a table monitor. `
cmd . Long = ` Create a table monitor .
Creates a new monitor for the specified table .
The caller must either : 1. be an owner of the table ' s parent catalog , have
* * USE_SCHEMA * * on the table ' s parent schema , and have * * SELECT * * access on the
table 2. have * * USE_CATALOG * * on the table ' s parent catalog , be an owner of
the table ' s parent schema , and have * * SELECT * * access on the table . 3. have
the following permissions : - * * USE_CATALOG * * on the table ' s parent catalog -
* * USE_SCHEMA * * on the table ' s parent schema - be an owner of the table .
Workspace assets , such as the dashboard , will be created in the workspace
where this call was made .
Arguments :
2024-04-16 12:03:21 +00:00
TABLE_NAME : Full name of the table .
2024-02-13 14:33:59 +00:00
ASSETS_DIR : The directory to store monitoring assets ( e . g . dashboard , metric tables ) .
OUTPUT_SCHEMA_NAME : Schema where output metric tables are created . `
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
if cmd . Flags ( ) . Changed ( "json" ) {
2024-03-12 14:12:34 +00:00
err := root . ExactArgs ( 1 ) ( cmd , args )
2024-02-13 14:33:59 +00:00
if err != nil {
2024-04-16 12:03:21 +00:00
return fmt . Errorf ( "when --json flag is specified, provide only TABLE_NAME as positional arguments. Provide 'assets_dir', 'output_schema_name' in your JSON input" )
2024-02-13 14:33:59 +00:00
}
return nil
}
2024-03-12 14:12:34 +00:00
check := root . ExactArgs ( 3 )
2024-02-13 14:33:59 +00:00
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
if cmd . Flags ( ) . Changed ( "json" ) {
err = createJson . Unmarshal ( & createReq )
if err != nil {
return err
}
}
2024-04-16 12:03:21 +00:00
createReq . TableName = args [ 0 ]
2024-02-13 14:33:59 +00:00
if ! cmd . Flags ( ) . Changed ( "json" ) {
createReq . AssetsDir = args [ 1 ]
}
if ! cmd . Flags ( ) . Changed ( "json" ) {
createReq . OutputSchemaName = args [ 2 ]
}
2024-05-22 07:41:32 +00:00
response , err := w . QualityMonitors . Create ( ctx , createReq )
2024-02-13 14:33:59 +00:00
if err != nil {
return err
}
return cmdio . Render ( ctx , response )
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range createOverrides {
fn ( cmd , & createReq )
}
return cmd
}
// start delete command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var deleteOverrides [ ] func (
* cobra . Command ,
2024-05-22 07:41:32 +00:00
* catalog . DeleteQualityMonitorRequest ,
2024-02-13 14:33:59 +00:00
)
func newDelete ( ) * cobra . Command {
cmd := & cobra . Command { }
2024-05-22 07:41:32 +00:00
var deleteReq catalog . DeleteQualityMonitorRequest
2024-02-13 14:33:59 +00:00
// TODO: short flags
2024-04-16 12:03:21 +00:00
cmd . Use = "delete TABLE_NAME"
2024-02-13 14:33:59 +00:00
cmd . Short = ` Delete a table monitor. `
cmd . Long = ` Delete a table monitor .
Deletes a monitor for the specified table .
The caller must either : 1. be an owner of the table ' s parent catalog 2. have
* * USE_CATALOG * * on the table ' s parent catalog and be an owner of the table ' s
parent schema 3. have the following permissions : - * * USE_CATALOG * * on the
table ' s parent catalog - * * USE_SCHEMA * * on the table ' s parent schema - be an
owner of the table .
Additionally , the call must be made from the workspace where the monitor was
created .
Note that the metric tables and dashboard will not be deleted as part of this
call ; those assets must be manually cleaned up ( if desired ) .
Arguments :
2024-04-16 12:03:21 +00:00
TABLE_NAME : Full name of the table . `
2024-02-13 14:33:59 +00:00
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
2024-03-12 14:12:34 +00:00
check := root . ExactArgs ( 1 )
2024-02-13 14:33:59 +00:00
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
2024-04-16 12:03:21 +00:00
deleteReq . TableName = args [ 0 ]
2024-02-13 14:33:59 +00:00
2024-05-22 07:41:32 +00:00
err = w . QualityMonitors . Delete ( ctx , deleteReq )
2024-02-13 14:33:59 +00:00
if err != nil {
return err
}
return nil
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range deleteOverrides {
fn ( cmd , & deleteReq )
}
return cmd
}
// start get command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var getOverrides [ ] func (
* cobra . Command ,
2024-05-22 07:41:32 +00:00
* catalog . GetQualityMonitorRequest ,
2024-02-13 14:33:59 +00:00
)
func newGet ( ) * cobra . Command {
cmd := & cobra . Command { }
2024-05-22 07:41:32 +00:00
var getReq catalog . GetQualityMonitorRequest
2024-02-13 14:33:59 +00:00
// TODO: short flags
2024-04-16 12:03:21 +00:00
cmd . Use = "get TABLE_NAME"
2024-02-13 14:33:59 +00:00
cmd . Short = ` Get a table monitor. `
cmd . Long = ` Get a table monitor .
Gets a monitor for the specified table .
The caller must either : 1. be an owner of the table ' s parent catalog 2. have
* * USE_CATALOG * * on the table ' s parent catalog and be an owner of the table ' s
parent schema . 3. have the following permissions : - * * USE_CATALOG * * on the
table ' s parent catalog - * * USE_SCHEMA * * on the table ' s parent schema -
* * SELECT * * privilege on the table .
The returned information includes configuration values , as well as information
on assets created by the monitor . Some information ( e . g . , dashboard ) may be
filtered out if the caller is in a different workspace than where the monitor
was created .
Arguments :
2024-04-16 12:03:21 +00:00
TABLE_NAME : Full name of the table . `
2024-02-13 14:33:59 +00:00
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
2024-03-12 14:12:34 +00:00
check := root . ExactArgs ( 1 )
2024-02-13 14:33:59 +00:00
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
2024-04-16 12:03:21 +00:00
getReq . TableName = args [ 0 ]
2024-02-13 14:33:59 +00:00
2024-05-22 07:41:32 +00:00
response , err := w . QualityMonitors . Get ( ctx , getReq )
2024-02-13 14:33:59 +00:00
if err != nil {
return err
}
return cmdio . Render ( ctx , response )
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range getOverrides {
fn ( cmd , & getReq )
}
return cmd
}
2024-02-15 14:52:17 +00:00
// start get-refresh command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var getRefreshOverrides [ ] func (
* cobra . Command ,
* catalog . GetRefreshRequest ,
)
func newGetRefresh ( ) * cobra . Command {
cmd := & cobra . Command { }
var getRefreshReq catalog . GetRefreshRequest
// TODO: short flags
2024-04-16 12:03:21 +00:00
cmd . Use = "get-refresh TABLE_NAME REFRESH_ID"
2024-02-15 14:52:17 +00:00
cmd . Short = ` Get refresh. `
cmd . Long = ` Get refresh .
Gets info about a specific monitor refresh using the given refresh ID .
The caller must either : 1. be an owner of the table ' s parent catalog 2. have
* * USE_CATALOG * * on the table ' s parent catalog and be an owner of the table ' s
parent schema 3. have the following permissions : - * * USE_CATALOG * * on the
table ' s parent catalog - * * USE_SCHEMA * * on the table ' s parent schema -
* * SELECT * * privilege on the table .
Additionally , the call must be made from the workspace where the monitor was
created .
Arguments :
2024-04-16 12:03:21 +00:00
TABLE_NAME : Full name of the table .
2024-02-15 14:52:17 +00:00
REFRESH_ID : ID of the refresh . `
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
2024-03-12 14:12:34 +00:00
check := root . ExactArgs ( 2 )
2024-02-15 14:52:17 +00:00
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
2024-04-16 12:03:21 +00:00
getRefreshReq . TableName = args [ 0 ]
2024-02-15 14:52:17 +00:00
getRefreshReq . RefreshId = args [ 1 ]
2024-05-22 07:41:32 +00:00
response , err := w . QualityMonitors . GetRefresh ( ctx , getRefreshReq )
2024-02-15 14:52:17 +00:00
if err != nil {
return err
}
return cmdio . Render ( ctx , response )
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range getRefreshOverrides {
fn ( cmd , & getRefreshReq )
}
return cmd
}
// start list-refreshes command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var listRefreshesOverrides [ ] func (
* cobra . Command ,
* catalog . ListRefreshesRequest ,
)
func newListRefreshes ( ) * cobra . Command {
cmd := & cobra . Command { }
var listRefreshesReq catalog . ListRefreshesRequest
// TODO: short flags
2024-04-16 12:03:21 +00:00
cmd . Use = "list-refreshes TABLE_NAME"
2024-02-15 14:52:17 +00:00
cmd . Short = ` List refreshes. `
cmd . Long = ` List refreshes .
Gets an array containing the history of the most recent refreshes ( up to 25 )
for this table .
The caller must either : 1. be an owner of the table ' s parent catalog 2. have
* * USE_CATALOG * * on the table ' s parent catalog and be an owner of the table ' s
parent schema 3. have the following permissions : - * * USE_CATALOG * * on the
table ' s parent catalog - * * USE_SCHEMA * * on the table ' s parent schema -
* * SELECT * * privilege on the table .
Additionally , the call must be made from the workspace where the monitor was
created .
Arguments :
2024-04-16 12:03:21 +00:00
TABLE_NAME : Full name of the table . `
2024-02-15 14:52:17 +00:00
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
2024-03-12 14:12:34 +00:00
check := root . ExactArgs ( 1 )
2024-02-15 14:52:17 +00:00
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
2024-04-16 12:03:21 +00:00
listRefreshesReq . TableName = args [ 0 ]
2024-02-15 14:52:17 +00:00
2024-05-22 07:41:32 +00:00
response , err := w . QualityMonitors . ListRefreshes ( ctx , listRefreshesReq )
2024-02-15 14:52:17 +00:00
if err != nil {
return err
}
return cmdio . Render ( ctx , response )
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range listRefreshesOverrides {
fn ( cmd , & listRefreshesReq )
}
return cmd
}
Bump github.com/databricks/databricks-sdk-go from 0.45.0 to 0.46.0 (#1760)
Bumps
[github.com/databricks/databricks-sdk-go](https://github.com/databricks/databricks-sdk-go)
from 0.45.0 to 0.46.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/databricks/databricks-sdk-go/releases">github.com/databricks/databricks-sdk-go's
releases</a>.</em></p>
<blockquote>
<h2>v0.46.0</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Fail fast when authenticating if host is not configured (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1033">#1033</a>).</li>
<li>Improve non-JSON error handling (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1031">#1031</a>).</li>
</ul>
<h3>Internal Changes</h3>
<ul>
<li>Add TestAccCreateOboTokenOnAws to flaky test list (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1029">#1029</a>).</li>
<li>Add workflows manage integration tests checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1032">#1032</a>).</li>
<li>Fix TestMwsAccWorkspaces cleanup (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1028">#1028</a>).</li>
<li>Improve integration test comment (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1035">#1035</a>).</li>
<li>Temporary ignore Metastore test failures (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1027">#1027</a>).</li>
<li>Update test to support new accounts (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1026">#1026</a>).</li>
<li>Use statuses instead of checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1036">#1036</a>).</li>
</ul>
<h3>API Changes:</h3>
<ul>
<li>Added <code>RegenerateDashboard</code> method for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#QualityMonitorsAPI">w.QualityMonitors</a>
workspace-level service.</li>
<li>Added <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RegenerateDashboardRequest">catalog.RegenerateDashboardRequest</a>
and <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RegenerateDashboardResponse">catalog.RegenerateDashboardResponse</a>.</li>
<li>Added <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#QueueDetails">jobs.QueueDetails</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#QueueDetailsCodeCode">jobs.QueueDetailsCodeCode</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunLifecycleStateV2State">jobs.RunLifecycleStateV2State</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunStatus">jobs.RunStatus</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationCodeCode">jobs.TerminationCodeCode</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationDetails">jobs.TerminationDetails</a>
and <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationTypeType">jobs.TerminationTypeType</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#BaseRun">jobs.BaseRun</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RepairHistoryItem">jobs.RepairHistoryItem</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Run">jobs.Run</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunTask">jobs.RunTask</a>.</li>
<li>Added <code>MaxProvisionedThroughput</code> and
<code>MinProvisionedThroughput</code> fields for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServedModelInput">serving.ServedModelInput</a>.</li>
<li>Added <code>ColumnsToSync</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/vectorsearch#DeltaSyncVectorIndexSpecRequest">vectorsearch.DeltaSyncVectorIndexSpecRequest</a>.</li>
<li>Changed <code>WorkloadSize</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServedModelInput">serving.ServedModelInput</a>
to no longer be required.</li>
</ul>
<p>OpenAPI SHA: d05898328669a3f8ab0c2ecee37db2673d3ea3f7, Date:
2024-09-04</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/databricks/databricks-sdk-go/blob/main/CHANGELOG.md">github.com/databricks/databricks-sdk-go's
changelog</a>.</em></p>
<blockquote>
<h2>[Release] Release v0.46.0</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Fail fast when authenticating if host is not configured (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1033">#1033</a>).</li>
<li>Improve non-JSON error handling (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1031">#1031</a>).</li>
</ul>
<h3>Internal Changes</h3>
<ul>
<li>Add TestAccCreateOboTokenOnAws to flaky test list (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1029">#1029</a>).</li>
<li>Add workflows manage integration tests checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1032">#1032</a>).</li>
<li>Fix TestMwsAccWorkspaces cleanup (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1028">#1028</a>).</li>
<li>Improve integration test comment (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1035">#1035</a>).</li>
<li>Temporary ignore Metastore test failures (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1027">#1027</a>).</li>
<li>Update test to support new accounts (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1026">#1026</a>).</li>
<li>Use statuses instead of checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/pull/1036">#1036</a>).</li>
</ul>
<h3>API Changes:</h3>
<ul>
<li>Added <code>RegenerateDashboard</code> method for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#QualityMonitorsAPI">w.QualityMonitors</a>
workspace-level service.</li>
<li>Added <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RegenerateDashboardRequest">catalog.RegenerateDashboardRequest</a>
and <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RegenerateDashboardResponse">catalog.RegenerateDashboardResponse</a>.</li>
<li>Added <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#QueueDetails">jobs.QueueDetails</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#QueueDetailsCodeCode">jobs.QueueDetailsCodeCode</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunLifecycleStateV2State">jobs.RunLifecycleStateV2State</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunStatus">jobs.RunStatus</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationCodeCode">jobs.TerminationCodeCode</a>,
<a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationDetails">jobs.TerminationDetails</a>
and <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationTypeType">jobs.TerminationTypeType</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#BaseRun">jobs.BaseRun</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RepairHistoryItem">jobs.RepairHistoryItem</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Run">jobs.Run</a>.</li>
<li>Added <code>Status</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunTask">jobs.RunTask</a>.</li>
<li>Added <code>MaxProvisionedThroughput</code> and
<code>MinProvisionedThroughput</code> fields for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServedModelInput">serving.ServedModelInput</a>.</li>
<li>Added <code>ColumnsToSync</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/vectorsearch#DeltaSyncVectorIndexSpecRequest">vectorsearch.DeltaSyncVectorIndexSpecRequest</a>.</li>
<li>Changed <code>WorkloadSize</code> field for <a
href="https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServedModelInput">serving.ServedModelInput</a>
to no longer be required.</li>
</ul>
<p>OpenAPI SHA: d05898328669a3f8ab0c2ecee37db2673d3ea3f7, Date:
2024-09-04</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/37cb031019b9cbe7e7388e6a14bcc6e54bbc13b5"><code>37cb031</code></a>
[Release] Release v0.46.0 (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1037">#1037</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/34f37f9e4cb179d854cde5796485932e538d8543"><code>34f37f9</code></a>
[Internal] Use statuses instead of checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1036">#1036</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/590d59704619647b958eec09f8faf9fa952ddd86"><code>590d597</code></a>
[Internal] Improve integration test comment (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1035">#1035</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/6ab81eed7850f16acb75e01fdd32193ea4b949cc"><code>6ab81ee</code></a>
[Internal] Add workflows manage integration tests checks (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1032">#1032</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/4886afe31293dddc1c26165faa057a9ed84e1f6d"><code>4886afe</code></a>
[Fix] Fail fast when authenticating if host is not configured (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1033">#1033</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/796dae1674b8ea1485e9c07b509f2bdc7a432c25"><code>796dae1</code></a>
[Fix] Handle non-JSON errors (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1031">#1031</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/a24a158b34b9bd0442e91450b3a599835558b612"><code>a24a158</code></a>
[Internal] Add TestAccCreateOboTokenOnAws to flaky test list (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1029">#1029</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/9ab8b42bc4694a4066ac22021e4ccde2da6f3d5f"><code>9ab8b42</code></a>
[Fix] Fix TestMwsAccWorkspaces cleanup (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1028">#1028</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/cc22621c96ed52279bdb41eb5ab78d03484bbdd0"><code>cc22621</code></a>
[Internal] Temporary ignore Metastore test failures (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1027">#1027</a>)</li>
<li><a
href="https://github.com/databricks/databricks-sdk-go/commit/8dbaaf2767ea79b619196f5e71c02793f8e75b24"><code>8dbaaf2</code></a>
[Fix] Update test to support new accounts (<a
href="https://redirect.github.com/databricks/databricks-sdk-go/issues/1026">#1026</a>)</li>
<li>See full diff in <a
href="https://github.com/databricks/databricks-sdk-go/compare/v0.45.0...v0.46.0">compare
view</a></li>
</ul>
</details>
<br />
<details>
<summary>Most Recent Ignore Conditions Applied to This Pull
Request</summary>
| Dependency Name | Ignore Conditions |
| --- | --- |
| github.com/databricks/databricks-sdk-go | [>= 0.28.a, < 0.29] |
</details>
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/databricks/databricks-sdk-go&package-manager=go_modules&previous-version=0.45.0&new-version=0.46.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nester <andrew.nester@databricks.com>
2024-09-09 14:49:39 +00:00
// start regenerate-dashboard command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var regenerateDashboardOverrides [ ] func (
* cobra . Command ,
* catalog . RegenerateDashboardRequest ,
)
func newRegenerateDashboard ( ) * cobra . Command {
cmd := & cobra . Command { }
var regenerateDashboardReq catalog . RegenerateDashboardRequest
var regenerateDashboardJson flags . JsonFlag
// TODO: short flags
cmd . Flags ( ) . Var ( & regenerateDashboardJson , "json" , ` either inline JSON string or @path/to/file.json with request body ` )
cmd . Flags ( ) . StringVar ( & regenerateDashboardReq . WarehouseId , "warehouse-id" , regenerateDashboardReq . WarehouseId , ` Optional argument to specify the warehouse for dashboard regeneration. ` )
cmd . Use = "regenerate-dashboard TABLE_NAME"
cmd . Short = ` Regenerate a monitoring dashboard. `
cmd . Long = ` Regenerate a monitoring dashboard .
Regenerates the monitoring dashboard for the specified table .
The caller must either : 1. be an owner of the table ' s parent catalog 2. have
* * USE_CATALOG * * on the table ' s parent catalog and be an owner of the table ' s
parent schema 3. have the following permissions : - * * USE_CATALOG * * on the
table ' s parent catalog - * * USE_SCHEMA * * on the table ' s parent schema - be an
owner of the table
The call must be made from the workspace where the monitor was created . The
dashboard will be regenerated in the assets directory that was specified when
the monitor was created .
Arguments :
TABLE_NAME : Full name of the table . `
// This command is being previewed; hide from help output.
cmd . Hidden = true
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
check := root . ExactArgs ( 1 )
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
if cmd . Flags ( ) . Changed ( "json" ) {
err = regenerateDashboardJson . Unmarshal ( & regenerateDashboardReq )
if err != nil {
return err
}
}
regenerateDashboardReq . TableName = args [ 0 ]
response , err := w . QualityMonitors . RegenerateDashboard ( ctx , regenerateDashboardReq )
if err != nil {
return err
}
return cmdio . Render ( ctx , response )
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range regenerateDashboardOverrides {
fn ( cmd , & regenerateDashboardReq )
}
return cmd
}
2024-02-15 14:52:17 +00:00
// start run-refresh command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var runRefreshOverrides [ ] func (
* cobra . Command ,
* catalog . RunRefreshRequest ,
)
func newRunRefresh ( ) * cobra . Command {
cmd := & cobra . Command { }
var runRefreshReq catalog . RunRefreshRequest
// TODO: short flags
2024-04-16 12:03:21 +00:00
cmd . Use = "run-refresh TABLE_NAME"
2024-02-15 14:52:17 +00:00
cmd . Short = ` Queue a metric refresh for a monitor. `
cmd . Long = ` Queue a metric refresh for a monitor .
Queues a metric refresh on the monitor for the specified table . The refresh
will execute in the background .
The caller must either : 1. be an owner of the table ' s parent catalog 2. have
* * USE_CATALOG * * on the table ' s parent catalog and be an owner of the table ' s
parent schema 3. have the following permissions : - * * USE_CATALOG * * on the
table ' s parent catalog - * * USE_SCHEMA * * on the table ' s parent schema - be an
owner of the table
Additionally , the call must be made from the workspace where the monitor was
created .
Arguments :
2024-04-16 12:03:21 +00:00
TABLE_NAME : Full name of the table . `
2024-02-15 14:52:17 +00:00
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
2024-03-12 14:12:34 +00:00
check := root . ExactArgs ( 1 )
2024-02-15 14:52:17 +00:00
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
2024-04-16 12:03:21 +00:00
runRefreshReq . TableName = args [ 0 ]
2024-02-15 14:52:17 +00:00
2024-05-22 07:41:32 +00:00
response , err := w . QualityMonitors . RunRefresh ( ctx , runRefreshReq )
2024-02-15 14:52:17 +00:00
if err != nil {
return err
}
return cmdio . Render ( ctx , response )
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range runRefreshOverrides {
fn ( cmd , & runRefreshReq )
}
return cmd
}
2024-02-13 14:33:59 +00:00
// start update command
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
var updateOverrides [ ] func (
* cobra . Command ,
* catalog . UpdateMonitor ,
)
func newUpdate ( ) * cobra . Command {
cmd := & cobra . Command { }
var updateReq catalog . UpdateMonitor
var updateJson flags . JsonFlag
// TODO: short flags
cmd . Flags ( ) . Var ( & updateJson , "json" , ` either inline JSON string or @path/to/file.json with request body ` )
cmd . Flags ( ) . StringVar ( & updateReq . BaselineTableName , "baseline-table-name" , updateReq . BaselineTableName , ` Name of the baseline table from which drift metrics are computed from. ` )
// TODO: array: custom_metrics
2024-05-22 07:41:32 +00:00
cmd . Flags ( ) . StringVar ( & updateReq . DashboardId , "dashboard-id" , updateReq . DashboardId , ` Id of dashboard that visualizes the computed metrics. ` )
2024-02-13 14:33:59 +00:00
// TODO: complex arg: data_classification_config
// TODO: complex arg: inference_log
2024-03-20 13:57:53 +00:00
// TODO: complex arg: notifications
2024-02-13 14:33:59 +00:00
// TODO: complex arg: schedule
// TODO: array: slicing_exprs
2024-03-20 13:57:53 +00:00
// TODO: complex arg: snapshot
2024-02-13 14:33:59 +00:00
// TODO: complex arg: time_series
2024-04-16 12:03:21 +00:00
cmd . Use = "update TABLE_NAME OUTPUT_SCHEMA_NAME"
2024-02-13 14:33:59 +00:00
cmd . Short = ` Update a table monitor. `
cmd . Long = ` Update a table monitor .
Updates a monitor for the specified table .
The caller must either : 1. be an owner of the table ' s parent catalog 2. have
* * USE_CATALOG * * on the table ' s parent catalog and be an owner of the table ' s
parent schema 3. have the following permissions : - * * USE_CATALOG * * on the
table ' s parent catalog - * * USE_SCHEMA * * on the table ' s parent schema - be an
owner of the table .
Additionally , the call must be made from the workspace where the monitor was
created , and the caller must be the original creator of the monitor .
Certain configuration fields , such as output asset identifiers , cannot be
updated .
Arguments :
2024-04-16 12:03:21 +00:00
TABLE_NAME : Full name of the table .
2024-02-13 14:33:59 +00:00
OUTPUT_SCHEMA_NAME : Schema where output metric tables are created . `
cmd . Annotations = make ( map [ string ] string )
cmd . Args = func ( cmd * cobra . Command , args [ ] string ) error {
if cmd . Flags ( ) . Changed ( "json" ) {
2024-03-12 14:12:34 +00:00
err := root . ExactArgs ( 1 ) ( cmd , args )
2024-02-13 14:33:59 +00:00
if err != nil {
2024-04-16 12:03:21 +00:00
return fmt . Errorf ( "when --json flag is specified, provide only TABLE_NAME as positional arguments. Provide 'output_schema_name' in your JSON input" )
2024-02-13 14:33:59 +00:00
}
return nil
}
2024-03-12 14:12:34 +00:00
check := root . ExactArgs ( 2 )
2024-02-13 14:33:59 +00:00
return check ( cmd , args )
}
cmd . PreRunE = root . MustWorkspaceClient
cmd . RunE = func ( cmd * cobra . Command , args [ ] string ) ( err error ) {
ctx := cmd . Context ( )
w := root . WorkspaceClient ( ctx )
if cmd . Flags ( ) . Changed ( "json" ) {
err = updateJson . Unmarshal ( & updateReq )
if err != nil {
return err
}
}
2024-04-16 12:03:21 +00:00
updateReq . TableName = args [ 0 ]
2024-02-13 14:33:59 +00:00
if ! cmd . Flags ( ) . Changed ( "json" ) {
2024-02-19 14:30:06 +00:00
updateReq . OutputSchemaName = args [ 1 ]
2024-02-13 14:33:59 +00:00
}
2024-05-22 07:41:32 +00:00
response , err := w . QualityMonitors . Update ( ctx , updateReq )
2024-02-13 14:33:59 +00:00
if err != nil {
return err
}
return cmdio . Render ( ctx , response )
}
// Disable completions since they are not applicable.
// Can be overridden by manual implementation in `override.go`.
cmd . ValidArgsFunction = cobra . NoFileCompletions
// Apply optional overrides to this command.
for _ , fn := range updateOverrides {
fn ( cmd , & updateReq )
}
return cmd
}
2024-05-22 07:41:32 +00:00
// end service QualityMonitors