Skip to content

Commit

Permalink
Merge branch 'main' into JOBS-20449
Browse files Browse the repository at this point in the history
  • Loading branch information
renaudhartert-db authored Nov 7, 2024
2 parents 12c6c97 + 9b7ca5d commit 3a5fe8a
Show file tree
Hide file tree
Showing 166 changed files with 3,766 additions and 2,467 deletions.
2 changes: 1 addition & 1 deletion .codegen/_openapi_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cf9c61453990df0f9453670f2fe68e1b128647a2
d25296d2f4aa7bd6195c816fdf82e0f960f775da
62 changes: 41 additions & 21 deletions .gitattributes

Large diffs are not rendered by default.

30 changes: 26 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
## Changes
<!-- Summary of your changes that are easy to understand -->
## What changes are proposed in this pull request?

## Tests
<!-- How is this tested? -->
Provide the readers and reviewers with the information they need to understand
this PR in a comprehensive manner.

Specifically, try to answer the two following questions:

- **WHAT** changes are being made in the PR? This should be a summary of the
major changes to allow the reader to quickly understand the PR without having
to look at the code.
- **WHY** are these changes needed? This should provide the context that the
reader might be missing. For example, were there any decisions behind the
change that are not reflected in the code itself?

The “why part” is the most important of the two as it usually cannot be
inferred from the code itself. A well-written PR description will help future
developers (including your future self) to know how to interact and update your
code.

## How is this tested?

Describe any tests you have done; especially if test tests are not part of
the unit tests (e.g. local tests).

**ALWAYS ANSWER THIS QUESTION:** Answer with "N/A" if tests are not applicable
to your PR (e.g. if the PR only modifies comments). Do not be afraid of
answering "Not tested" if the PR has not been tested. Being clear about what
has been done and not done provides important context to the reviewers.
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
# Version changelog

## [Release] Release v0.35.0

### New Features and Improvements

* DatabricksConfig: Add clone() support ([#376](https://github.com/databricks/databricks-sdk-java/pull/376)).


### Bug Fixes

* Fix vulnerabilities in the present SDK version ([#383](https://github.com/databricks/databricks-sdk-java/pull/383)).


### Internal Changes

* Add test instructions for external contributors ([#370](https://github.com/databricks/databricks-sdk-java/pull/370)).
* Always write message for manual test integration ([#374](https://github.com/databricks/databricks-sdk-java/pull/374)).
* Automatically trigger integration tests on PR ([#369](https://github.com/databricks/databricks-sdk-java/pull/369)).
* Move templates in the code generator ([#373](https://github.com/databricks/databricks-sdk-java/pull/373)).
* Refresh PR template ([#381](https://github.com/databricks/databricks-sdk-java/pull/381)).


### API Changes:

* Added `workspaceClient.aibiDashboardEmbeddingAccessPolicy()` service and `workspaceClient.aibiDashboardEmbeddingApprovedDomains()` service.
* Added `workspaceClient.credentials()` service.
* Added `appDeployment` field for `com.databricks.sdk.service.apps.CreateAppDeploymentRequest`.
* Added `app` field for `com.databricks.sdk.service.apps.CreateAppRequest`.
* Added `app` field for `com.databricks.sdk.service.apps.UpdateAppRequest`.
* Added `table` field for `com.databricks.sdk.service.catalog.CreateOnlineTableRequest`.
* Added `azureAad` field for `com.databricks.sdk.service.catalog.GenerateTemporaryTableCredentialResponse`.
* Added `omitUsername` field for `com.databricks.sdk.service.catalog.ListTablesRequest`.
* Added `fullName` field for `com.databricks.sdk.service.catalog.StorageCredentialInfo`.
* Added `dashboard` field for `com.databricks.sdk.service.dashboards.CreateDashboardRequest`.
* Added `schedule` field for `com.databricks.sdk.service.dashboards.CreateScheduleRequest`.
* Added `subscription` field for `com.databricks.sdk.service.dashboards.CreateSubscriptionRequest`.
* Added `warehouseId` field for `com.databricks.sdk.service.dashboards.Schedule`.
* Added `dashboard` field for `com.databricks.sdk.service.dashboards.UpdateDashboardRequest`.
* Added `schedule` field for `com.databricks.sdk.service.dashboards.UpdateScheduleRequest`.
* Added `only` field for `com.databricks.sdk.service.jobs.RunNow`.
* Added `pageToken` field for `com.databricks.sdk.service.oauth2.ListServicePrincipalSecretsRequest`.
* Added `nextPageToken` field for `com.databricks.sdk.service.oauth2.ListServicePrincipalSecretsResponse`.
* Added `restartWindow` field for `com.databricks.sdk.service.pipelines.CreatePipeline`.
* Added `restartWindow` field for `com.databricks.sdk.service.pipelines.EditPipeline`.
* Added `connectionName` field for `com.databricks.sdk.service.pipelines.IngestionGatewayPipelineDefinition`.
* Added `restartWindow` field for `com.databricks.sdk.service.pipelines.PipelineSpec`.
* Added `isNoPublicIpEnabled` field for `com.databricks.sdk.service.provisioning.CreateWorkspaceRequest`.
* Added `privateAccessSettingsId` field for `com.databricks.sdk.service.provisioning.UpdateWorkspaceRequest`.
* Added `externalCustomerInfo` and `isNoPublicIpEnabled` fields for `com.databricks.sdk.service.provisioning.Workspace`.
* Added `lastUsedDay` field for `com.databricks.sdk.service.settings.TokenInfo`.
* Changed `create()` method for `workspaceClient.apps()` service with new required argument order.
* Changed `executeMessageQuery()` method for `workspaceClient.genie()` service . New request type is `com.databricks.sdk.service.dashboards.GenieExecuteMessageQueryRequest` class.
* Changed `executeMessageQuery()` method for `workspaceClient.genie()` service to type `executeMessageQuery()` method for `workspaceClient.genie()` service.
* Changed `create()`, `createSchedule()`, `createSubscription()` and `updateSchedule()` methods for `workspaceClient.lakeview()` service with new required argument order.
* Removed `workspaceClient.cleanRooms()` service.
* Removed `deploymentId`, `mode` and `sourceCodePath` fields for `com.databricks.sdk.service.apps.CreateAppDeploymentRequest`.
* Removed `description`, `name` and `resources` fields for `com.databricks.sdk.service.apps.CreateAppRequest`.
* Removed `description` and `resources` fields for `com.databricks.sdk.service.apps.UpdateAppRequest`.
* Removed `name` and `spec` fields for `com.databricks.sdk.service.catalog.CreateOnlineTableRequest`.
* Removed `displayName`, `parentPath`, `serializedDashboard` and `warehouseId` fields for `com.databricks.sdk.service.dashboards.CreateDashboardRequest`.
* Removed `cronSchedule`, `displayName` and `pauseStatus` fields for `com.databricks.sdk.service.dashboards.CreateScheduleRequest`.
* Removed `subscriber` field for `com.databricks.sdk.service.dashboards.CreateSubscriptionRequest`.
* Removed `displayName`, `etag`, `serializedDashboard` and `warehouseId` fields for `com.databricks.sdk.service.dashboards.UpdateDashboardRequest`.
* Removed `cronSchedule`, `displayName`, `etag` and `pauseStatus` fields for `com.databricks.sdk.service.dashboards.UpdateScheduleRequest`.
* Removed `prevPageToken` field for `com.databricks.sdk.service.jobs.Run`.

OpenAPI SHA: d25296d2f4aa7bd6195c816fdf82e0f960f775da, Date: 2024-11-07


## [Release] Release v0.34.0

### New Features and Improvements
Expand Down
10 changes: 5 additions & 5 deletions 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.34.0</version>
<version>0.35.0</version>
</parent>
<artifactId>databricks-sdk-java</artifactId>
<properties>
Expand Down Expand Up @@ -49,9 +49,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ini4j</groupId>
<artifactId>ini4j</artifactId>
<version>0.5.4</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.11.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -67,7 +67,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.13.0</version>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package com.databricks.sdk.core;

import com.databricks.sdk.core.utils.Environment;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Paths;
import java.util.*;
import org.ini4j.Ini;
import org.ini4j.Profile;
import org.apache.commons.configuration2.INIConfiguration;
import org.apache.commons.configuration2.SubnodeConfiguration;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -40,7 +41,7 @@ public static DatabricksConfig resolve(DatabricksConfig cfg) throws DatabricksEx
}
}

static void loadFromEnvironmentVariables(DatabricksConfig cfg) throws IllegalAccessException {
static void loadFromEnvironmentVariables(DatabricksConfig cfg) {
if (cfg.getEnv() == null) {
return;
}
Expand All @@ -57,7 +58,7 @@ static void loadFromEnvironmentVariables(DatabricksConfig cfg) throws IllegalAcc
}
accessor.setValueOnConfig(cfg, env);
}
} catch (DatabricksException e) {
} catch (DatabricksException | IllegalAccessException e) {
String msg =
String.format("%s auth: %s", cfg.getCredentialsProvider().authType(), e.getMessage());
throw new DatabricksException(msg, e);
Expand Down Expand Up @@ -86,46 +87,46 @@ static void loadFromConfig(DatabricksConfig cfg) throws IllegalAccessException {
configFile = configFile.replaceFirst("^~", userHome);
}

Ini ini = parseDatabricksCfg(configFile, isDefaultConfig);
INIConfiguration ini = parseDatabricksCfg(configFile, isDefaultConfig);
if (ini == null) return;

String profile = cfg.getProfile();
boolean hasExplicitProfile = !isNullOrEmpty(profile);
if (!hasExplicitProfile) {
profile = "DEFAULT";
}

Profile.Section section = ini.get(profile);
if (section == null && !hasExplicitProfile) {
SubnodeConfiguration section = ini.getSection(profile);
boolean sectionNotPresent = section == null || section.isEmpty();
if (sectionNotPresent && !hasExplicitProfile) {
LOG.info("{} has no {} profile configured", configFile, profile);
return;
}

if (section == null) {
if (sectionNotPresent) {
String msg = String.format("resolve: %s has no %s profile configured", configFile, profile);
throw new DatabricksException(msg);
}

for (ConfigAttributeAccessor accessor : accessors) {
String value = section.get(accessor.getName());
String value = section.getString(accessor.getName());
if (!isNullOrEmpty(accessor.getValueFromConfig(cfg))) {
continue;
}
accessor.setValueOnConfig(cfg, value);
}
}

private static Ini parseDatabricksCfg(String configFile, boolean isDefaultConfig) {
Ini ini = new Ini();
try {
ini.load(new File(configFile));
private static INIConfiguration parseDatabricksCfg(String configFile, boolean isDefaultConfig) {
INIConfiguration iniConfig = new INIConfiguration();
try (FileReader reader = new FileReader(configFile)) {
iniConfig.read(reader);
} catch (FileNotFoundException e) {
if (isDefaultConfig) {
return null;
}
} catch (IOException e) {
} catch (IOException | ConfigurationException e) {
throw new DatabricksException("Cannot load " + configFile, e);
}
return ini;
return iniConfig;
}

public static void fixHostIfNeeded(DatabricksConfig cfg) {
Expand Down Expand Up @@ -230,12 +231,12 @@ public static String debugString(DatabricksConfig cfg) {
if (!attrsUsed.isEmpty()) {
buf.add(String.format("Config: %s", String.join(", ", attrsUsed)));
} else {
buf.add(String.format("Config: <empty>"));
buf.add("Config: <empty>");
}
if (!envsUsed.isEmpty()) {
buf.add(String.format("Env: %s", String.join(", ", envsUsed)));
} else {
buf.add(String.format("Env: <none>"));
buf.add("Env: <none>");
}
return String.join(". ", buf);
} catch (IllegalAccessException e) {
Expand Down
Loading

0 comments on commit 3a5fe8a

Please sign in to comment.