Skip to content

Commit 37bbe40

Browse files
committed
test: after-fix sync (committed sorted subtree, spec bb6433a6) — expect fmt pass
1 parent 780d960 commit 37bbe40

323 files changed

Lines changed: 32308 additions & 7489 deletions

File tree

Some content is hidden

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

.codegen.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"mode": "py_v0",
3+
"api_changelog": false,
4+
"version": {
5+
"databricks/sdk/version.py": "__version__ = \"$VERSION\""
6+
},
7+
"sync": {
8+
"skip_from_genkit": [
9+
".github/workflows/next-changelog.yml",
10+
"tagging.py",
11+
"tagging.py.lock"
12+
],
13+
"skip_from_source": [
14+
"BUILD.bazel",
15+
"CLAUDE.md",
16+
"OWNERS",
17+
"README.md",
18+
"changelog.json",
19+
"releases.jsonl",
20+
".cursor",
21+
".cursorrules",
22+
".nextchanges",
23+
"changelog_validate",
24+
"next-changelog.yml",
25+
"tagging.py"
26+
],
27+
"rename_on_sync": {
28+
"README.public.md": "README.md"
29+
}
30+
},
31+
"toolchain": {
32+
"required": ["python3.12", "uv"],
33+
"pre_setup": [
34+
"python3.12 -m venv .databricks"
35+
],
36+
"prepend_path": ".databricks/bin",
37+
"setup": [
38+
"pip install '.[dev]'"
39+
],
40+
"post_generate": [
41+
"make fmt",
42+
"pip install .",
43+
"python3.12 docs/gen-client-docs.py"
44+
]
45+
}
46+
}

.codegen/_openapi_sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9ce12048f2c4a4fefb93fc3f55cba9c9798f9cb6
1+
bb6433a6fab9f514ae007ef4cb93fb839a83108d

.gitattributes

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
databricks/sdk/__init__.py linguist-generated=true
22
databricks/sdk/errors/overrides.py linguist-generated=true
33
databricks/sdk/errors/platform.py linguist-generated=true
4-
databricks/sdk/service/__init__.py linguist-generated=true
5-
databricks/sdk/service/_internal.py linguist-generated=true
64
databricks/sdk/service/agentbricks.py linguist-generated=true
75
databricks/sdk/service/aisearch.py linguist-generated=true
86
databricks/sdk/service/apps.py linguist-generated=true
97
databricks/sdk/service/billing.py linguist-generated=true
10-
databricks/sdk/service/bundle.py linguist-generated=true
118
databricks/sdk/service/bundledeployments.py linguist-generated=true
129
databricks/sdk/service/catalog.py linguist-generated=true
1310
databricks/sdk/service/cleanrooms.py linguist-generated=true

.github/workflows/tagging.yml

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ jobs:
3535
github.repository == 'databricks/databricks-sdk-go' ||
3636
github.repository == 'databricks/databricks-sdk-py' ||
3737
github.repository == 'databricks/databricks-sdk-java'
38-
env:
39-
# Ref the release is cut from. Releasing from a branch is currently
40-
# supported in the terraform repository only: for
41-
# terraform-provider-databricks this follows the dispatched branch
42-
# (``github.ref_name``), so a release can be cut from a branch other
43-
# than main; every other synced repo (SDK go/py/java, …) stays pinned
44-
# to main, preserving the pre-existing hardcoded-main behaviour and
45-
# blocking branch releases even via a manual non-main dispatch.
46-
RELEASE_REF: ${{ github.repository == 'databricks/terraform-provider-databricks' && github.ref_name || 'main' }}
4738
environment: "release-is"
4839
runs-on:
4940
group: databricks-protected-runner-group
@@ -59,19 +50,12 @@ jobs:
5950
- name: Checkout repository
6051
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6152
with:
62-
# Check out the release ref. ``RELEASE_REF`` is the dispatched
63-
# branch for terraform-provider-databricks and ``main`` for every
64-
# other repo (see the job-level ``env``). For scheduled runs and
65-
# manual dispatches left at defaults this is the default branch
66-
# (main); dispatching terraform with ``--ref <branch>`` cuts the
67-
# release from that branch instead.
68-
#
69-
# Naming the ref explicitly (rather than omitting ``ref:``)
70-
# forces re-resolution of the branch head at step time. Without
71-
# it, checkout pins to ``github.sha`` — the SHA frozen at
72-
# workflow_dispatch time — so re-running a stale dispatch would
73-
# check out an older commit even when newer ones exist.
74-
ref: ${{ env.RELEASE_REF }}
53+
# Force re-resolution of ``main`` at step time. Without
54+
# ``ref:``, checkout pins to ``github.sha`` — the SHA frozen
55+
# at workflow_dispatch time — which means re-running a stale
56+
# dispatch checks out an older main even when newer commits
57+
# exist.
58+
ref: main
7559
fetch-depth: 0
7660
token: ${{ steps.generate-token.outputs.token }}
7761

@@ -89,12 +73,6 @@ jobs:
8973
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
9074
GITHUB_REPOSITORY: ${{ github.repository }}
9175
PACKAGES: ${{ inputs.packages }}
92-
# Branch the release is cut from. tagging.py commits the
93-
# changelog bump and creates the tag on this branch, and its
94-
# concurrent-advance guard checks this branch. Matches the ref
95-
# checked out above (``RELEASE_REF``): the dispatched branch for
96-
# terraform, main everywhere else.
97-
DECO_TAGGING_REF: ${{ env.RELEASE_REF }}
9876
run: |
9977
if [ -n "$PACKAGES" ]; then
10078
uv run --locked tagging.py --package "$PACKAGES"

databricks/sdk/__init__.py

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

databricks/sdk/_base_client.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import io
2+
import json
23
import logging
34
import urllib.parse
45
from abc import ABC, abstractmethod
5-
from datetime import timedelta
6+
from datetime import date, datetime, timedelta
7+
from enum import Enum
68
from types import TracebackType
79
from typing import Any, BinaryIO, Callable, Dict, Iterable, Iterator, List, Optional, Type, Union
810

@@ -19,6 +21,27 @@
1921
logger = logging.getLogger("databricks.sdk")
2022

2123

24+
def _json_default(o: Any) -> Any:
25+
"""``json.dumps`` ``default`` hook coercing SDK values into their wire form.
26+
27+
Lets an open ``Any`` body field accept an SDK response passed straight into
28+
the next call (function chaining), which is otherwise not JSON serializable.
29+
"""
30+
as_dict = getattr(o, "as_dict", None)
31+
if callable(as_dict):
32+
return as_dict()
33+
to_json_string = getattr(o, "ToJsonString", None) # protobuf Timestamp/Duration, FieldMask
34+
if callable(to_json_string):
35+
return to_json_string()
36+
if isinstance(o, (datetime, date)):
37+
return o.isoformat()
38+
if isinstance(o, timedelta):
39+
return f"{o.total_seconds()}s"
40+
if isinstance(o, Enum):
41+
return o.value
42+
raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable")
43+
44+
2245
def _fix_host_if_needed(host: Optional[str]) -> Optional[str]:
2346
if not host:
2447
return host
@@ -281,14 +304,18 @@ def _perform(
281304
data=None,
282305
auth: Callable[[requests.PreparedRequest], requests.PreparedRequest] = None,
283306
):
307+
json_data = None
308+
if body is not None and data is None and files is None:
309+
json_data = json.dumps(body, allow_nan=False, default=_json_default)
310+
headers = {"Content-Type": "application/json", **(headers or {})}
284311
response = self._session.request(
285312
method,
286313
url,
287314
params=self._fix_query_string(query),
288-
json=body,
315+
json=None if json_data is not None else body,
289316
headers=headers,
290317
files=files,
291-
data=data,
318+
data=json_data if json_data is not None else data,
292319
auth=auth,
293320
stream=raw,
294321
timeout=self._http_timeout_seconds,

databricks/sdk/errors/overrides.py

100644100755
File mode changed.

databricks/sdk/errors/platform.py

100644100755
File mode changed.

databricks/sdk/service/__init__.py

100644100755
File mode changed.

databricks/sdk/service/_internal.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)