diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index a08cdd46e..3c86080ee 100755 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -55d22d7e7879e6be815cfe8e3e4cf7130f822c94 \ No newline at end of file +f7c2fb590bc8a2eb185baf35469a13895528632f \ No newline at end of file diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md old mode 100644 new mode 100755 index e94bcd655..9c897270c --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -13,3 +13,5 @@ ### Internal Changes ### API Changes +* Add `TypeOverrides` field for [database.SyncedTableSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/database#SyncedTableSpec). +* Add `TypeOverrides` field for [postgres.SyncedTableSyncedTableSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/postgres#SyncedTableSyncedTableSpec). \ No newline at end of file diff --git a/service/catalog/model.go b/service/catalog/model.go index 3af89f205..b37bde606 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -970,7 +970,7 @@ func (s ConnectionInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Next Id: 126 +// Next Id: 127 type ConnectionType string const ConnectionTypeBigquery ConnectionType = `BIGQUERY` @@ -7271,7 +7271,7 @@ func (s Securable) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Latest kind: CONNECTION_ADOBE_CAMPAIGNS_OAUTH_M2M = 345; Next id: 346. +// Latest kind: CONNECTION_CONFLUENT_SCHEMA_REGISTRY_BASIC = 346; Next id: 347. // Reserved numbers: 316, 317, 327, 330, 341 (former ENDPOINT_LLM_*, // MODEL_SERVICE_STANDARD, MODEL_SERVICE_SYSTEM_DELTASHARING, // MCP_SERVICE_STANDARD). diff --git a/service/dashboards/model.go b/service/dashboards/model.go index 8cd511a2c..03227aee1 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -2036,7 +2036,6 @@ type RevertDashboardRequest struct { DashboardId string `json:"-" url:"-"` // The etag for the dashboard. Optionally, it can be provided to verify that // the dashboard has not been modified from its last retrieval. - // TODO(TSE-3937): update to new non-CMK-encrypted label when available Etag string `json:"etag,omitempty"` ForceSendFields []string `json:"-" url:"-"` diff --git a/service/database/model.go b/service/database/model.go index 54e863edc..d645563cc 100755 --- a/service/database/model.go +++ b/service/database/model.go @@ -1175,6 +1175,10 @@ type SyncedTableSpec struct { // Time series key to deduplicate (tie-break) rows with the same primary // key. TimeseriesKey string `json:"timeseries_key,omitempty"` + // Override the default Delta->PG type mapping for specific columns. A + // TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid + // pg_type must be set. + TypeOverrides []SyncedTableSpecTypeOverride `json:"type_overrides,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -1187,6 +1191,64 @@ func (s SyncedTableSpec) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// PostgreSQL-specific target types that can override the default Delta-to-PG +// mapping. +type SyncedTableSpecPgSpecificType string + +const SyncedTableSpecPgSpecificTypePgSpecificTypeVector SyncedTableSpecPgSpecificType = `PG_SPECIFIC_TYPE_VECTOR` + +// String representation for [fmt.Print] +func (f *SyncedTableSpecPgSpecificType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *SyncedTableSpecPgSpecificType) Set(v string) error { + switch v { + case `PG_SPECIFIC_TYPE_VECTOR`: + *f = SyncedTableSpecPgSpecificType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "PG_SPECIFIC_TYPE_VECTOR"`, v) + } +} + +// Values returns all possible values for SyncedTableSpecPgSpecificType. +// +// There is no guarantee on the order of the values in the slice. +func (f *SyncedTableSpecPgSpecificType) Values() []SyncedTableSpecPgSpecificType { + return []SyncedTableSpecPgSpecificType{ + SyncedTableSpecPgSpecificTypePgSpecificTypeVector, + } +} + +// Type always returns SyncedTableSpecPgSpecificType to satisfy [pflag.Value] interface +func (f *SyncedTableSpecPgSpecificType) Type() string { + return "SyncedTableSpecPgSpecificType" +} + +// Overrides the default Delta-to-PostgreSQL type mapping for a single column. +type SyncedTableSpecTypeOverride struct { + // Name of the source column whose target PostgreSQL type should be + // overridden. + ColumnName string `json:"column_name"` + // PostgreSQL-specific target type to use for the column. + PgType SyncedTableSpecPgSpecificType `json:"pg_type"` + // Size parameter for the target type. Required when pg_type is + // PG_SPECIFIC_TYPE_VECTOR (specifies the vector dimension, e.g., 1024). + Size int `json:"size,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SyncedTableSpecTypeOverride) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SyncedTableSpecTypeOverride) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // The state of a synced table. type SyncedTableState string diff --git a/service/marketplace/model.go b/service/marketplace/model.go index f3578d0d9..8c1db1fad 100755 --- a/service/marketplace/model.go +++ b/service/marketplace/model.go @@ -708,7 +708,7 @@ func (s FileInfo) MarshalJSON() ([]byte, error) { type FileParent struct { FileParentType FileParentType `json:"file_parent_type,omitempty" url:"file_parent_type,omitempty"` - // TODO make the following fields required + ParentId string `json:"parent_id,omitempty" url:"parent_id,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -1504,8 +1504,7 @@ type ListingDetail struct { // listings with model based assets License string `json:"license,omitempty"` // What the pricing model is (e.g. paid, subscription, paid upfront); should - // only be present if cost is paid TODO: Not used yet, should deprecate if - // we will never use it + // only be present if cost is paid PricingModel string `json:"pricing_model,omitempty"` PrivacyPolicyLink string `json:"privacy_policy_link,omitempty"` diff --git a/service/ml/model.go b/service/ml/model.go index 79fdb7058..86aa0e6ae 100755 --- a/service/ml/model.go +++ b/service/ml/model.go @@ -334,7 +334,7 @@ func (s AuthConfig) MarshalJSON() ([]byte, error) { type AvgFunction struct { // The input column from which the average is computed. For Kafka sources, // use dot-prefixed path notation (e.g., "value.amount"). For nested fields, - // the leaf node name is used. TODO(FS-939): Colon-prefixed notation (e.g., + // the leaf node name is used. Colon-prefixed notation (e.g., // "value:amount") is supported for backwards compatibility but is // deprecated; migrate to dot notation. Input string `json:"input"` @@ -502,9 +502,9 @@ func (s ContinuousWindow) MarshalJSON() ([]byte, error) { type CountFunction struct { // The input column from which the count is computed. For Kafka sources, use // dot-prefixed path notation (e.g., "value.amount"). For nested fields, the - // leaf node name is used. TODO(FS-939): Colon-prefixed notation (e.g., - // "value:amount") is supported for backwards compatibility but is - // deprecated; migrate to dot notation. + // leaf node name is used. Colon-prefixed notation (e.g., "value:amount") is + // supported for backwards compatibility but is deprecated; migrate to dot + // notation. Input string `json:"input"` } @@ -1197,8 +1197,7 @@ func (s DeltaTableSource) MarshalJSON() ([]byte, error) { } // Direct connection configs for mTLS, as Kafka Connections do not support mTLS -// yet (XTA-18030). Temporarily used until UC Kafka Connections gain mTLS -// support. +// yet . Temporarily used until UC Kafka Connections gain mTLS support. type DirectMtlsConfig struct { // A comma-separated list of host:port pairs for the Kafka bootstrap // servers. @@ -1226,9 +1225,8 @@ type EntityColumn struct { // "value.user_id", "key.partition_key"). For nested fields, the leaf node // name (e.g., "user_id" from "value.trip_details.user_id") is what will be // present in materialized tables and expected to match at query time. - // TODO(FS-939): Colon-prefixed notation (e.g., "value:user_id") is - // supported for backwards compatibility but is deprecated; migrate to dot - // notation. + // Colon-prefixed notation (e.g., "value:user_id") is supported for + // backwards compatibility but is deprecated; migrate to dot notation. Name string `json:"name"` } @@ -2312,7 +2310,7 @@ func (s LineageContext) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Feature for model version. ([ML-57150] Renamed from Feature to LinkedFeature) +// Feature for model version. type LinkedFeature struct { // Feature name FeatureName string `json:"feature_name,omitempty"` @@ -4883,8 +4881,8 @@ type StddevPopFunction struct { // The input column from which the population standard deviation is // computed. For Kafka sources, use dot-prefixed path notation (e.g., // "value.amount"). For nested fields, the leaf node name is used. - // TODO(FS-939): Colon-prefixed notation (e.g., "value:amount") is supported - // for backwards compatibility but is deprecated; migrate to dot notation. + // Colon-prefixed notation (e.g., "value:amount") is supported for backwards + // compatibility but is deprecated; migrate to dot notation. Input string `json:"input"` } @@ -4940,8 +4938,8 @@ func (s Stream) MarshalJSON() ([]byte, error) { // Specifies how to connect and authenticate to the stream platform. type StreamConnectionConfig struct { // Direct mTLS configuration for stream platform access. This is only used - // in the short term until UC Kafka Connections support mTLS (XTA-18030). - // Once UC Kafka Connections support mTLS, this will be deprecated. + // in the short term until UC Kafka Connections support mTLS . Once UC Kafka + // Connections support mTLS, this will be deprecated. DirectMtlsConfig *DirectMtlsConfig `json:"direct_mtls_config,omitempty"` // Name of an existing UC Connection for stream platform access. Must be the // correct type for the streaming platform (e.g. a Kafka Connection for a @@ -5062,9 +5060,9 @@ func (s SubscriptionMode) MarshalJSON() ([]byte, error) { type SumFunction struct { // The input column from which the sum is computed. For Kafka sources, use // dot-prefixed path notation (e.g., "value.amount"). For nested fields, the - // leaf node name is used. TODO(FS-939): Colon-prefixed notation (e.g., - // "value:amount") is supported for backwards compatibility but is - // deprecated; migrate to dot notation. + // leaf node name is used. Colon-prefixed notation (e.g., "value:amount") is + // supported for backwards compatibility but is deprecated; migrate to dot + // notation. Input string `json:"input"` } @@ -5115,9 +5113,9 @@ type TimeseriesColumn struct { // "value.event_timestamp"). For nested fields, the leaf node name (e.g., // "event_timestamp" from "value.event_details.event_timestamp") is what // will be present in materialized tables and expected to match at query - // time. TODO(FS-939): Colon-prefixed notation (e.g., - // "value:event_timestamp") is supported for backwards compatibility but is - // deprecated; migrate to dot notation. + // time. Colon-prefixed notation (e.g., "value:event_timestamp") is + // supported for backwards compatibility but is deprecated; migrate to dot + // notation. Name string `json:"name"` } diff --git a/service/postgres/model.go b/service/postgres/model.go index c7951671a..5a277a647 100755 --- a/service/postgres/model.go +++ b/service/postgres/model.go @@ -2307,6 +2307,10 @@ type SyncedTableSyncedTableSpec struct { // Time series key to deduplicate (tie-break) rows with the same primary // key. TimeseriesKey string `json:"timeseries_key,omitempty"` + // Override the default Delta->PG type mapping for specific columns. A + // TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid + // pg_type must be set. + TypeOverrides []SyncedTableSyncedTableSpecTypeOverride `json:"type_overrides,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -2319,6 +2323,42 @@ func (s SyncedTableSyncedTableSpec) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// PostgreSQL-specific target types that can override the default Delta-to-PG +// mapping. +type SyncedTableSyncedTableSpecPgSpecificType string + +const SyncedTableSyncedTableSpecPgSpecificTypePgSpecificTypeVector SyncedTableSyncedTableSpecPgSpecificType = `PG_SPECIFIC_TYPE_VECTOR` + +// String representation for [fmt.Print] +func (f *SyncedTableSyncedTableSpecPgSpecificType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *SyncedTableSyncedTableSpecPgSpecificType) Set(v string) error { + switch v { + case `PG_SPECIFIC_TYPE_VECTOR`: + *f = SyncedTableSyncedTableSpecPgSpecificType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "PG_SPECIFIC_TYPE_VECTOR"`, v) + } +} + +// Values returns all possible values for SyncedTableSyncedTableSpecPgSpecificType. +// +// There is no guarantee on the order of the values in the slice. +func (f *SyncedTableSyncedTableSpecPgSpecificType) Values() []SyncedTableSyncedTableSpecPgSpecificType { + return []SyncedTableSyncedTableSpecPgSpecificType{ + SyncedTableSyncedTableSpecPgSpecificTypePgSpecificTypeVector, + } +} + +// Type always returns SyncedTableSyncedTableSpecPgSpecificType to satisfy [pflag.Value] interface +func (f *SyncedTableSyncedTableSpecPgSpecificType) Type() string { + return "SyncedTableSyncedTableSpecPgSpecificType" +} + // Scheduling policy of the synced table's underlying pipeline. type SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy string @@ -2360,6 +2400,28 @@ func (f *SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy) Type() string { return "SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy" } +// Overrides the default Delta-to-PostgreSQL type mapping for a single column. +type SyncedTableSyncedTableSpecTypeOverride struct { + // Name of the source column whose target PostgreSQL type should be + // overridden. + ColumnName string `json:"column_name"` + // PostgreSQL-specific target type to use for the column. + PgType SyncedTableSyncedTableSpecPgSpecificType `json:"pg_type"` + // Size parameter for the target type. Required when pg_type is + // PG_SPECIFIC_TYPE_VECTOR (specifies the vector dimension, e.g., 1024). + Size int `json:"size,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SyncedTableSyncedTableSpecTypeOverride) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SyncedTableSyncedTableSpecTypeOverride) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type SyncedTableSyncedTableStatus struct { // The state of the synced table. DetailedState SyncedTableState `json:"detailed_state,omitempty"` diff --git a/service/provisioning/model.go b/service/provisioning/model.go index 2bfc0dbd1..b781e2b38 100755 --- a/service/provisioning/model.go +++ b/service/provisioning/model.go @@ -1248,9 +1248,7 @@ func (s UpdateWorkspaceRequest) MarshalJSON() ([]byte, error) { // * type VpcEndpoint struct { - // The Databricks account ID that hosts the VPC endpoint configuration. TODO - // - This may signal an OpenAPI diff; it does not show up in the generated - // spec + // The Databricks account ID that hosts the VPC endpoint configuration. AccountId string `json:"account_id,omitempty"` // The AWS Account in which the VPC endpoint object exists. AwsAccountId string `json:"aws_account_id,omitempty"` diff --git a/service/settings/model.go b/service/settings/model.go index 797d88774..7604ad1aa 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -4189,13 +4189,7 @@ func (s NetworkConnectivityConfiguration) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// The network policies applying for egress traffic. This message is used by the -// UI/REST API. We translate this message to the format expected by the -// dataplane in Lakehouse Network Manager (for the format expected by the -// dataplane, see networkconfig.textproto). This policy should be consistent -// with [[com.databricks.api.proto.settingspolicy.EgressNetworkPolicy]]. Details -// see API-design: -// https://docs.google.com/document/d/1DKWO_FpZMCY4cF2O62LpwII1lx8gsnDGG-qgE3t3TOA/ +// The network policies applying for egress traffic. type NetworkPolicyEgress struct { // The access policy enforced for egress traffic to the internet. NetworkAccess *EgressNetworkPolicyNetworkAccessPolicy `json:"network_access,omitempty"` diff --git a/service/sql/model.go b/service/sql/model.go index 91809f457..525004948 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -4949,11 +4949,6 @@ func (f *SetWorkspaceWarehouseConfigRequestSecurityPolicy) Type() string { // | AWS | On Demand Driver with Spot Executors | On Demand Driver and Executors // | | AZURE | On Demand Driver and Executors | On Demand Driver and Executors | // +-------+--------------------------------------+--------------------------------+ -// -// While including "spot" in the enum name may limit the the future -// extensibility of this field because it limits this enum to denoting "spot or -// not", this is the field that PM recommends after discussion with customers -// per SC-48783. type SpotInstancePolicy string const SpotInstancePolicyCostOptimized SpotInstancePolicy = `COST_OPTIMIZED`