Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen/_last_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
53e4c6273d2874b13429a178dbbc57b5aac59fbb
87ad00d1beb89e2c7efa32e8d4df78b6a715a1fa
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Version changelog

## Release v0.187.0 (2026-12-02)

### API Changes
* Add `batchUpdateOperations()` and `checkEnrollments()` methods for `workspaceClient.bundleDeployments()` service.
* Add `sharingPolicy` and `spaceType` fields for `com.databricks.sdk.service.apps.Space`.
* Add `disabled` field for `com.databricks.sdk.service.catalog.InferenceTableConfig`.
* Add `ignoreNulls` field for `com.databricks.sdk.service.ml.FirstDistinctFunction`.
* Add `ignoreNulls` field for `com.databricks.sdk.service.ml.FirstFunction`.
* Add `ignoreNulls` field for `com.databricks.sdk.service.ml.FirstNFunction`.
* Add `ignoreNulls` field for `com.databricks.sdk.service.ml.LastDistinctFunction`.
* Add `ignoreNulls` field for `com.databricks.sdk.service.ml.LastFunction`.
* Add `ignoreNulls` field for `com.databricks.sdk.service.ml.LastNFunction`.
* Add `cpu` and `memoryMib` fields for `com.databricks.sdk.service.sandbox.ComputeSpec`.
* Add `storage` field for `com.databricks.sdk.service.sandbox.SandboxSpec`.
* Add `asana` and `serviceNow` fields for `com.databricks.sdk.service.settings.Config`.
* Add `effectiveRepoAllowlistPermission` and `repoAllowlistPermission` fields for `com.databricks.sdk.service.settingsv2.Setting`.
* Add `CAN_BUILD` enum value for `com.databricks.sdk.service.apps.AppPermissionLevel`.
* Add `CAN_BUILD` enum value for `com.databricks.sdk.service.iam.PermissionLevel`.
* Add `ASANA` and `SERVICE_NOW` enum values for `com.databricks.sdk.service.settings.DestinationType`.
* [Breaking] Remove `finalAttemptOnly` field for `com.databricks.sdk.service.ml.MaterializationFailureNotification`.
* [Breaking] Remove `DESTINATION_KIND_DESIGNER_FILE` enum value for `com.databricks.sdk.service.geniemigrate.DestinationKind`.
* [Breaking] Remove `SOURCE_DIALECT_INFORMATICA`, `SOURCE_DIALECT_SSIS` and `SOURCE_DIALECT_ALTERYX` enum values for `com.databricks.sdk.service.geniemigrate.SourceDialect`.
* [Breaking] Remove `TARGET_FRAMEWORK_SPARK_DECLARATIVE_PIPELINES` and `TARGET_FRAMEWORK_DESIGNER` enum values for `com.databricks.sdk.service.geniemigrate.TargetFramework`.

## Release v0.186.0 (2026-11-25)

### API Changes
Expand Down
2 changes: 1 addition & 1 deletion databricks-sdk-java/lockfile.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"artifactId": "databricks-sdk-java",
"groupId": "com.databricks",
"version": "0.186.0",
"version": "0.187.0",
"lockFileVersion": 1,
"dependencies": [
{
Expand Down
2 changes: 1 addition & 1 deletion databricks-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.databricks</groupId>
<artifactId>databricks-sdk-parent</artifactId>
<version>0.186.0</version>
<version>0.187.0</version>
</parent>
<artifactId>databricks-sdk-java</artifactId>
<name>Databricks SDK for Java</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public String getValue() {
// TODO: check if reading from
// /META-INF/maven/com.databricks/databrics-sdk-java/pom.properties
// or getClass().getPackage().getImplementationVersion() is enough.
private static final String version = "0.186.0";
private static final String version = "0.187.0";

public static void withProduct(String product, String productVersion) {
UserAgent.product = product;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
package com.databricks.sdk.mixin;

import com.databricks.sdk.WorkspaceClient;
import com.databricks.sdk.core.ApiClient;
import com.databricks.sdk.core.DatabricksConfig;
import com.databricks.sdk.core.logging.LoggerFactory;
import com.databricks.sdk.core.retry.NoRetryStrategyPicker;
import com.databricks.sdk.service.files.FilesAPI;
import com.databricks.sdk.service.files.FilesService;

/**
* The Files API, with the client of the Files transfer extension. Use {@link #of(WorkspaceClient)}
* to reach the methods that {@code workspaceClient.files()} does not declare. Upload and download
* are the generated single-request calls.
*
* <p>The extension needs the client's {@link DatabricksConfig}. A {@code FilesExt} built with one
* has a copy of the API client that sends each workspace call once. A {@code FilesExt} built
* without one, from an {@link ApiClient} alone or from a mock {@link FilesService}, has no
* extension: the classic {@link ApiClient} cannot be copied without its retries.
*/
public class FilesExt extends FilesAPI {
/**
* The workspace API client the transfer extension sends through, one attempt per call, or null if
* this {@code FilesExt} has no extension.
*/
private final ApiClient singleAttemptApiClient;

/** A {@code FilesExt} without the transfer extension: see the class documentation. */
public FilesExt(ApiClient apiClient) {
super(apiClient);
this.singleAttemptApiClient = null;
}

/**
* A {@code FilesExt} with the transfer extension, as {@code WorkspaceClient} builds it; use
* {@link #of(WorkspaceClient)} to get one. {@code config} must be the configuration {@code
* apiClient} was built from, or the generated calls and the extension's would use different
* clients.
*
* <p>It never throws for the extension, which must not fail what works without it. If {@code
* config} gives another HTTP client than {@code apiClient} has, or its single-attempt client
* cannot be built, it logs a warning and has no extension.
*/
public FilesExt(ApiClient apiClient, DatabricksConfig config) {
super(apiClient);
this.singleAttemptApiClient = singleAttemptApiClientOrNull(apiClient, config);
}

/** A {@code FilesExt} over a mock, without the transfer extension. */
public FilesExt(FilesService mock) {
super(mock);
this.singleAttemptApiClient = null;
}

/**
* Returns {@code workspaceClient.files()} as a {@code FilesExt}: the same object if it is one,
* otherwise one over the same {@link FilesService}, which has no transfer extension.
*/
public static FilesExt of(WorkspaceClient workspaceClient) {
FilesAPI files = workspaceClient.files();
if (files == null) {
throw new IllegalStateException(
"workspaceClient.files() is not set; set it with withFilesAPI or withFilesImpl");
}
if (files instanceof FilesExt) {
return (FilesExt) files;
}
FilesService service = files.impl();
if (service == null) {
throw new IllegalStateException(
"workspaceClient.files() has no FilesService; tests that call FilesExt.of(w) should"
+ " inject mock(FilesExt.class) with withFilesAPI");
}
return new FilesExt(service);
}

/** Whether transfers use the extension rather than the generated single-request path. */
boolean hasTransferExtension() {
return singleAttemptApiClient != null;
}

/** The workspace API client of the transfer extension, or null without one. */
ApiClient singleAttemptApiClient() {
return singleAttemptApiClient;
}

/** What the single-attempt workspace client's responses said, or null without the extension. */
FilesExtResponseRecorder workspaceResponses() {
return singleAttemptApiClient == null
? null
: (FilesExtResponseRecorder) singleAttemptApiClient.getHttpClient();
}

/**
* A copy of the API client {@code config} gives that sends each call once. The user's own client
* and config keep their retries.
*/
private static ApiClient singleAttemptApiClientOrNull(
ApiClient apiClient, DatabricksConfig config) {
try {
DatabricksConfig resolved = resolved(config);
if (apiClient.getHttpClient() != resolved.getHttpClient()) {
warnWithoutExtension(
"the config is not the one the API client was built from: they have different HTTP"
+ " clients");
return null;
}
return singleAttemptApiClient(resolved);
} catch (RuntimeException e) {
warnWithoutExtension("its single-attempt API client could not be built: " + e);
return null;
}
}

private static void warnWithoutExtension(String reason) {
// Looked up here, not held in a field, so that the logger factory in use applies.
LoggerFactory.getLogger(FilesExt.class)
.warn(
"The Files transfer extension is off, using the generated upload and download: {}",
reason);
}

private static ApiClient singleAttemptApiClient(DatabricksConfig resolved) {
return new ApiClient.Builder()
.withDatabricksConfig(resolved)
.withHttpClient(new FilesExtResponseRecorder(resolved.getHttpClient()))
.withRetryStrategyPicker(new NoRetryStrategyPicker())
.build();
}

private static DatabricksConfig resolved(DatabricksConfig config) {
// ApiClient(config) has resolved it already; resolving again would fetch host metadata again.
return config.getHttpClient() == null ? config.resolve() : config;
}
}
Loading
Loading