Skip to content

Commit e728169

Browse files
Merge branch 'main' into gkiko10/JOBS-19305
2 parents 473b64c + f7f9a68 commit e728169

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1968
-1640
lines changed

.codegen/_openapi_sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cf9c61453990df0f9453670f2fe68e1b128647a2
1+
5285ce76f81314f342c1702d5c2ad4ef42488781

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
## Changes
2-
<!-- Summary of your changes that are easy to understand -->
1+
## What changes are proposed in this pull request?
32

4-
## Tests
5-
<!--
6-
How is this tested? Please see the checklist below and also describe any other relevant tests
7-
-->
3+
Provide the readers and reviewers with the information they need to understand
4+
this PR in a comprehensive manner.
85

9-
- [ ] `make test` run locally
10-
- [ ] `make fmt` applied
11-
- [ ] relevant integration tests applied
6+
Specifically, try to answer the two following questions:
127

8+
- **WHAT** changes are being made in the PR? This should be a summary of the
9+
major changes to allow the reader to quickly understand the PR without having
10+
to look at the code.
11+
- **WHY** are these changes needed? This should provide the context that the
12+
reader might be missing. For example, were there any decisions behind the
13+
change that are not reflected in the code itself?
14+
15+
The “why part” is the most important of the two as it usually cannot be
16+
inferred from the code itself. A well-written PR description will help future
17+
developers (including your future self) to know how to interact and update your
18+
code.
19+
20+
## How is this tested?
21+
22+
Describe any tests you have done; especially if test tests are not part of
23+
the unit tests (e.g. local tests).
24+
25+
**ALWAYS ANSWER THIS QUESTION:** Answer with "N/A" if tests are not applicable
26+
to your PR (e.g. if the PR only modifies comments). Do not be afraid of
27+
answering "Not tested" if the PR has not been tested. Being clear about what
28+
has been done and not done provides important context to the reviewers.

.github/workflows/external-message.yml

Lines changed: 5 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -11,81 +11,22 @@ on:
1111
branches:
1212
- main
1313

14-
1514
jobs:
1615
comment-on-pr:
1716
runs-on: ubuntu-latest
1817
permissions:
1918
pull-requests: write
2019

2120
steps:
22-
# NOTE: The following checks may not be accurate depending on Org or Repo settings.
23-
- name: Check user and potential secret access
24-
id: check-secrets-access
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
run: |
28-
USER_LOGIN="${{ github.event.pull_request.user.login }}"
29-
REPO_OWNER="${{ github.repository_owner }}"
30-
REPO_NAME="${{ github.event.repository.name }}"
31-
32-
echo "Pull request opened by: $USER_LOGIN"
33-
34-
# Check if PR is from a fork
35-
IS_FORK=$([[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]] && echo "true" || echo "false")
36-
37-
HAS_ACCESS="false"
38-
39-
# Check user's permission level on the repository
40-
USER_PERMISSION=$(gh api repos/$REPO_OWNER/$REPO_NAME/collaborators/$USER_LOGIN/permission --jq '.permission')
41-
42-
if [[ "$USER_PERMISSION" == "admin" || "$USER_PERMISSION" == "write" ]]; then
43-
HAS_ACCESS="true"
44-
elif [[ "$USER_PERMISSION" == "read" ]]; then
45-
# For read access, we need to check if the user has been explicitly granted secret access
46-
# This information is not directly available via API, so we'll make an assumption
47-
# that read access does not imply secret access
48-
HAS_ACCESS="false"
49-
fi
50-
51-
# Check if repo owner is an organization
52-
IS_ORG=$(gh api users/$REPO_OWNER --jq '.type == "Organization"')
53-
54-
if [[ "$IS_ORG" == "true" && "$HAS_ACCESS" == "false" ]]; then
55-
# Check if user is a member of any team with write or admin access to the repo
56-
TEAMS_WITH_ACCESS=$(gh api repos/$REPO_OWNER/$REPO_NAME/teams --jq '.[] | select(.permission == "push" or .permission == "admin") | .slug')
57-
for team in $TEAMS_WITH_ACCESS; do
58-
IS_TEAM_MEMBER=$(gh api orgs/$REPO_OWNER/teams/$team/memberships/$USER_LOGIN --silent && echo "true" || echo "false")
59-
if [[ "$IS_TEAM_MEMBER" == "true" ]]; then
60-
HAS_ACCESS="true"
61-
break
62-
fi
63-
done
64-
fi
65-
66-
# If it's a fork, set HAS_ACCESS to false regardless of other checks
67-
if [[ "$IS_FORK" == "true" ]]; then
68-
HAS_ACCESS="false"
69-
fi
70-
71-
echo "has_secrets_access=$HAS_ACCESS" >> $GITHUB_OUTPUT
72-
if [[ "$HAS_ACCESS" == "true" ]]; then
73-
echo "User $USER_LOGIN likely has access to secrets"
74-
else
75-
echo "User $USER_LOGIN likely does not have access to secrets"
76-
fi
77-
78-
7921
- uses: actions/checkout@v4
8022

8123
- name: Delete old comments
82-
if: steps.check-secrets-access.outputs.has_secrets_access != 'true'
8324
env:
8425
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8526
run: |
8627
# Delete previous comment if it exists
8728
previous_comment_ids=$(gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
88-
--jq '.[] | select(.body | startswith("<!-- INTEGRATION_TESTS -->")) | .id')
29+
--jq '.[] | select(.body | startswith("<!-- INTEGRATION_TESTS_MANUAL -->")) | .id')
8930
echo "Previous comment IDs: $previous_comment_ids"
9031
# Iterate over each comment ID and delete the comment
9132
if [ ! -z "$previous_comment_ids" ]; then
@@ -96,14 +37,15 @@ jobs:
9637
fi
9738
9839
- name: Comment on PR
99-
if: steps.check-secrets-access.outputs.has_secrets_access != 'true'
10040
env:
10141
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10242
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
10343
run: |
10444
gh pr comment ${{ github.event.pull_request.number }} --body \
105-
"<!-- INTEGRATION_TESTS -->
106-
Run integration tests manually:
45+
"<!-- INTEGRATION_TESTS_MANUAL -->
46+
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:
47+
48+
Trigger:
10749
[go/deco-tests-run/sdk-py](https://go/deco-tests-run/sdk-py)
10850
10951
Inputs:

.github/workflows/integration-tests.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ jobs:
1212
check-token:
1313
name: Check secrets access
1414
runs-on: ubuntu-latest
15+
environment: "test-trigger-is"
1516
outputs:
1617
has_token: ${{ steps.set-token-status.outputs.has_token }}
1718
steps:
18-
- name: Check if GITHUB_TOKEN is set
19+
- name: Check if DECO_WORKFLOW_TRIGGER_APP_ID is set
1920
id: set-token-status
2021
run: |
21-
if [ -z "${{ secrets.GITHUB_TOKEN }}" ]; then
22-
echo "GITHUB_TOKEN is empty. User has no access to tokens."
23-
echo "::set-output name=has_token::false"
24-
else
25-
echo "GITHUB_TOKEN is set. User has no access to tokens."
26-
echo "::set-output name=has_token::true"
27-
fi
28-
22+
if [ -z "${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}" ]; then
23+
echo "DECO_WORKFLOW_TRIGGER_APP_ID is empty. User has no access to secrets."
24+
echo "::set-output name=has_token::false"
25+
else
26+
echo "DECO_WORKFLOW_TRIGGER_APP_ID is set. User has access to secrets."
27+
echo "::set-output name=has_token::true"
28+
fi
29+
2930
trigger-tests:
3031
name: Trigger Tests
3132
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# Version changelog
22

3+
## [Release] Release v0.37.0
4+
5+
### Bug Fixes
6+
7+
* Correctly generate classes with nested body fields ([#808](https://github.com/databricks/databricks-sdk-py/pull/808)).
8+
9+
10+
### Internal Changes
11+
12+
* Add `cleanrooms` package ([#806](https://github.com/databricks/databricks-sdk-py/pull/806)).
13+
* Add test instructions for external contributors ([#804](https://github.com/databricks/databricks-sdk-py/pull/804)).
14+
* Always write message for manual test execution ([#811](https://github.com/databricks/databricks-sdk-py/pull/811)).
15+
* Automatically trigger integration tests on PR ([#800](https://github.com/databricks/databricks-sdk-py/pull/800)).
16+
* Better isolate ML serving auth unit tests ([#803](https://github.com/databricks/databricks-sdk-py/pull/803)).
17+
* Move templates in the code generator ([#809](https://github.com/databricks/databricks-sdk-py/pull/809)).
18+
19+
20+
### API Changes:
21+
22+
* Added [w.aibi_dashboard_embedding_access_policy](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/aibi_dashboard_embedding_access_policy.html) workspace-level service and [w.aibi_dashboard_embedding_approved_domains](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/aibi_dashboard_embedding_approved_domains.html) workspace-level service.
23+
* Added [w.credentials](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/credentials.html) workspace-level service.
24+
* Added `app_deployment` field for `databricks.sdk.service.apps.CreateAppDeploymentRequest`.
25+
* Added `app` field for `databricks.sdk.service.apps.CreateAppRequest`.
26+
* Added `app` field for `databricks.sdk.service.apps.UpdateAppRequest`.
27+
* Added `table` field for `databricks.sdk.service.catalog.CreateOnlineTableRequest`.
28+
* Added `azure_aad` field for `databricks.sdk.service.catalog.GenerateTemporaryTableCredentialResponse`.
29+
* Added `full_name` field for `databricks.sdk.service.catalog.StorageCredentialInfo`.
30+
* Added `dashboard` field for `databricks.sdk.service.dashboards.CreateDashboardRequest`.
31+
* Added `schedule` field for `databricks.sdk.service.dashboards.CreateScheduleRequest`.
32+
* Added `subscription` field for `databricks.sdk.service.dashboards.CreateSubscriptionRequest`.
33+
* Added `warehouse_id` field for `databricks.sdk.service.dashboards.Schedule`.
34+
* Added `dashboard` field for `databricks.sdk.service.dashboards.UpdateDashboardRequest`.
35+
* Added `schedule` field for `databricks.sdk.service.dashboards.UpdateScheduleRequest`.
36+
* Added `page_token` field for `databricks.sdk.service.oauth2.ListServicePrincipalSecretsRequest`.
37+
* Added `next_page_token` field for `databricks.sdk.service.oauth2.ListServicePrincipalSecretsResponse`.
38+
* Added `connection_name` field for `databricks.sdk.service.pipelines.IngestionGatewayPipelineDefinition`.
39+
* Added `is_no_public_ip_enabled` field for `databricks.sdk.service.provisioning.CreateWorkspaceRequest`.
40+
* Added `external_customer_info` and `is_no_public_ip_enabled` fields for `databricks.sdk.service.provisioning.Workspace`.
41+
* Added `last_used_day` field for `databricks.sdk.service.settings.TokenInfo`.
42+
* Changed `create()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service with new required argument order.
43+
* Changed `execute_message_query()` method for [w.genie](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/genie.html) workspace-level service . New request type is `databricks.sdk.service.dashboards.GenieExecuteMessageQueryRequest` dataclass.
44+
* Changed `execute_message_query()` method for [w.genie](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/genie.html) workspace-level service to type `execute_message_query()` method for [w.genie](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/genie.html) workspace-level service.
45+
* Changed `create()`, `create_schedule()`, `create_subscription()` and `update_schedule()` methods for [w.lakeview](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/lakeview.html) workspace-level service with new required argument order.
46+
* Removed [w.clean_rooms](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/clean_rooms.html) workspace-level service.
47+
* Removed `deployment_id`, `mode` and `source_code_path` fields for `databricks.sdk.service.apps.CreateAppDeploymentRequest`.
48+
* Removed `description`, `name` and `resources` fields for `databricks.sdk.service.apps.CreateAppRequest`.
49+
* Removed `description` and `resources` fields for `databricks.sdk.service.apps.UpdateAppRequest`.
50+
* Removed `name` and `spec` fields for `databricks.sdk.service.catalog.CreateOnlineTableRequest`.
51+
* Removed `display_name`, `parent_path`, `serialized_dashboard` and `warehouse_id` fields for `databricks.sdk.service.dashboards.CreateDashboardRequest`.
52+
* Removed `cron_schedule`, `display_name` and `pause_status` fields for `databricks.sdk.service.dashboards.CreateScheduleRequest`.
53+
* Removed `subscriber` field for `databricks.sdk.service.dashboards.CreateSubscriptionRequest`.
54+
* Removed `display_name`, `etag`, `serialized_dashboard` and `warehouse_id` fields for `databricks.sdk.service.dashboards.UpdateDashboardRequest`.
55+
* Removed `cron_schedule`, `display_name`, `etag` and `pause_status` fields for `databricks.sdk.service.dashboards.UpdateScheduleRequest`.
56+
* Removed `prev_page_token` field for `databricks.sdk.service.jobs.Run`.
57+
58+
OpenAPI SHA: 5285ce76f81314f342c1702d5c2ad4ef42488781, Date: 2024-11-04
59+
360
## [Release] Release v0.36.0
461

562
### Breaking Changes

databricks/sdk/__init__.py

Lines changed: 19 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)