Skip to content
Closed
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/_openapi_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8f5eedbc991c4f04ce1284406577b0c92d59a224
9e3b5bea423b52a4510fbb70de9b2df76f9d39ed
2 changes: 1 addition & 1 deletion databricks/sdk/service/catalog.py

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

18 changes: 6 additions & 12 deletions databricks/sdk/service/compute.py

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

7 changes: 5 additions & 2 deletions databricks/sdk/service/sql.py

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

4 changes: 2 additions & 2 deletions docs/account/iam/workspace_assignment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@

spn_id = spn.id

workspace_id = os.environ["TEST_WORKSPACE_ID"]
workspace_id = os.environ["DUMMY_WORKSPACE_ID"]

a.workspace_assignment.update(
_ = a.workspace_assignment.update(
workspace_id=workspace_id,
principal_id=spn_id,
permissions=[iam.WorkspacePermission.USER],
Expand Down
6 changes: 5 additions & 1 deletion docs/account/provisioning/storage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

.. code-block::

import os
import time

from databricks.sdk import AccountClient
Expand All @@ -25,8 +26,11 @@

storage = a.storage.create(
storage_configuration_name=f"sdk-{time.time_ns()}",
root_bucket_info=provisioning.RootBucketInfo(bucket_name=f"sdk-{time.time_ns()}"),
root_bucket_info=provisioning.RootBucketInfo(bucket_name=os.environ["TEST_ROOT_BUCKET"]),
)

# cleanup
a.storage.delete(storage_configuration_id=storage.storage_configuration_id)

Creates a Databricks storage configuration for an account.

Expand Down
2 changes: 1 addition & 1 deletion docs/dbdataclasses/catalog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ These dataclasses are used in the SDK to represent API requests and responses fo

.. py:class:: SecurableKind

Latest kind: SECRET_EXTERNAL_AWS_SECRETS_MANAGER = 273; Next id:274
Latest kind: CREDENTIAL_STORAGE_UC_CONNECTION = 275; Next id:276

.. py:attribute:: TABLE_DB_STORAGE
:value: "TABLE_DB_STORAGE"
Expand Down
13 changes: 6 additions & 7 deletions docs/workspace/catalog/external_locations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@

credential = w.storage_credentials.create(
name=f"sdk-{time.time_ns()}",
aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]),
aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]),
)

created = w.external_locations.create(
name=f"sdk-{time.time_ns()}",
credential_name=credential.name,
url="s3://%s/%s" % (os.environ["TEST_BUCKET"], f"sdk-{time.time_ns()}"),
url=f's3://{os.environ["TEST_BUCKET"]}/sdk-{time.time_ns()}',
)

_ = w.external_locations.get(name=created.name)
_ = w.external_locations.get(get=created.name)

# cleanup
w.storage_credentials.delete(name=credential.name)
w.external_locations.delete(name=created.name)
w.storage_credentials.delete(delete=credential.name)
w.external_locations.delete(delete=created.name)

Gets an external location from the metastore. The caller must be either a metastore admin, the owner
of the external location, or a user that has some privilege on the external location.
Expand All @@ -140,11 +140,10 @@
.. code-block::

from databricks.sdk import WorkspaceClient
from databricks.sdk.service import catalog

w = WorkspaceClient()

all = w.external_locations.list(catalog.ListExternalLocationsRequest())
all = w.external_locations.list()

Gets an array of external locations (__ExternalLocationInfo__ objects) from the metastore. The caller
must be a metastore admin, the owner of the external location, or a user that has some privilege on
Expand Down
10 changes: 5 additions & 5 deletions docs/workspace/catalog/storage_credentials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@

created = w.storage_credentials.create(
name=f"sdk-{time.time_ns()}",
aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]),
aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]),
)

# cleanup
w.storage_credentials.delete(delete=created.name)
w.storage_credentials.delete(name=created.name)

Creates a new storage credential.

Expand Down Expand Up @@ -173,17 +173,17 @@

created = w.storage_credentials.create(
name=f"sdk-{time.time_ns()}",
aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]),
aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]),
)

_ = w.storage_credentials.update(
name=created.name,
comment=f"sdk-{time.time_ns()}",
aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]),
aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]),
)

# cleanup
w.storage_credentials.delete(delete=created.name)
w.storage_credentials.delete(name=created.name)

Updates a storage credential on the metastore.

Expand Down
2 changes: 1 addition & 1 deletion docs/workspace/catalog/tables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

created_schema = w.schemas.create(name=f"sdk-{time.time_ns()}", catalog_name=created_catalog.name)

summaries = w.tables.list_summaries(catalog_name=created_catalog.name, schema_name_pattern=created_schema.name)
all_tables = w.tables.list(catalog_name=created_catalog.name, schema_name=created_schema.name)

# cleanup
w.schemas.delete(full_name=created_schema.full_name)
Expand Down
6 changes: 2 additions & 4 deletions docs/workspace/compute/clusters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@
node_type_id take precedence.
:param enable_elastic_disk: bool (optional)
Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk space
when its Spark workers are running low on disk space. This feature requires specific AWS permissions
to function correctly - refer to the User Guide for more details.
when its Spark workers are running low on disk space.
:param enable_local_disk_encryption: bool (optional)
Whether to enable LUKS on cluster VMs' local disks
:param gcp_attributes: :class:`GcpAttributes` (optional)
Expand Down Expand Up @@ -402,8 +401,7 @@
node_type_id take precedence.
:param enable_elastic_disk: bool (optional)
Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk space
when its Spark workers are running low on disk space. This feature requires specific AWS permissions
to function correctly - refer to the User Guide for more details.
when its Spark workers are running low on disk space.
:param enable_local_disk_encryption: bool (optional)
Whether to enable LUKS on cluster VMs' local disks
:param gcp_attributes: :class:`GcpAttributes` (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/workspace/iam/current_user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

w = WorkspaceClient()

me2 = w.current_user.me()
me = w.current_user.me()

Get details about the current method caller's identity.

Expand Down
13 changes: 6 additions & 7 deletions docs/workspace/ml/model_registry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

model = w.model_registry.create_model(name=f"sdk-{time.time_ns()}")

created = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp")
mv = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp")

Creates a new registered model with the name specified in the request body. Throws
`RESOURCE_ALREADY_EXISTS` if a registered model with the given name exists.
Expand Down Expand Up @@ -122,7 +122,7 @@

model = w.model_registry.create_model(name=f"sdk-{time.time_ns()}")

created = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp")
mv = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp")

Creates a model version.

Expand Down Expand Up @@ -736,14 +736,13 @@

w = WorkspaceClient()

model = w.model_registry.create_model(name=f"sdk-{time.time_ns()}")
created = w.model_registry.create_model(name=f"sdk-{time.time_ns()}")

created = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp")
model = w.model_registry.get_model(name=created.registered_model.name)

w.model_registry.update_model_version(
w.model_registry.update_model(
name=model.registered_model_databricks.name,
description=f"sdk-{time.time_ns()}",
name=created.model_version.name,
version=created.model_version.version,
)

Updates a registered model.
Expand Down
2 changes: 1 addition & 1 deletion docs/workspace/sql/queries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
display_name=f"sdk-{time.time_ns()}",
warehouse_id=srcs[0].warehouse_id,
description="test query from Go SDK",
query_text="SHOW TABLES",
query_text="SELECT 1",
)
)

Expand Down
21 changes: 14 additions & 7 deletions docs/workspace/workspace/workspace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

notebook = f"/Users/{w.current_user.me().user_name}/sdk-{time.time_ns()}"

export_response = w.workspace.export_(format=workspace.ExportFormat.SOURCE, path=notebook)
export_response = w.workspace.export(format=workspace.ExportFormat.SOURCE, path=notebook)

Exports an object or the contents of an entire directory.

Expand Down Expand Up @@ -148,9 +148,9 @@

w = WorkspaceClient()

notebook_path = f"/Users/{w.current_user.me().user_name}/sdk-{time.time_ns()}"
notebook = f"/Users/{w.current_user.me().user_name}/sdk-{time.time_ns()}"

obj = w.workspace.get_status(path=notebook_path)
get_status_response = w.workspace.get_status(path=notebook)

Gets the status of an object or a directory. If `path` does not exist, this call returns an error
`RESOURCE_DOES_NOT_EXIST`.
Expand Down Expand Up @@ -179,11 +179,18 @@
notebook_path = f"/Users/{w.current_user.me().user_name}/sdk-{time.time_ns()}"

w.workspace.import_(
content=base64.b64encode(("CREATE LIVE TABLE dlt_sample AS SELECT 1").encode()).decode(),
format=workspace.ImportFormat.SOURCE,
language=workspace.Language.SQL,
overwrite=true_,
path=notebook_path,
overwrite=True,
format=workspace.ImportFormat.SOURCE,
language=workspace.Language.PYTHON,
content=base64.b64encode(
(
"""import time
time.sleep(10)
dbutils.notebook.exit('hello')
"""
).encode()
).decode(),
)

Imports a workspace object (for example, a notebook or file) or the contents of an entire directory.
Expand Down
Loading