unitycatalog¶
Python client for unitycatalog-rs, the Rust reimplementation of Unity Catalog OSS.
Client wraps the Rust uc-client. It takes the root URL of the server. Each
method comes twice: name waits for the response, and name_async returns an
awaitable. The requests on one catalog, schema, table and so on are on its handle,
such as client.catalog("main"):
import asyncio
from unitycatalog import Client
client = Client("http://localhost:8080/")
client.create_catalog("main", comment="primary")
print([c.name for c in client.list_catalogs()])
async def main():
catalog = await client.catalog("main").get_async()
print(catalog.id)
asyncio.run(main())
The classes of the requests and responses are in a module per API package,
such as unitycatalog.tables, with the enums of that package.
Enums are enum.StrEnum classes; a parameter takes a member or its name. An
error answer raises UnityCatalogError, or the subclass of its HTTP status, such as
NotFoundError.
With sign-in, Client(url, token=...) sends a fixed token, and Client(url) signs in
with the identity of the environment: an Azure or Google identity, an OAuth client, or
a token in UC_TOKEN. Client(url, token_provider=...) names the token source: one
of unitycatalog.identity, or a callable that returns the token.
Classes
| Name | Description |
|---|---|
BadRequestError |
The server answered 400 Bad Request: the request is not valid. |
Client |
A client of the API at one base URL. |
ConflictError |
The server answered 409 Conflict: the resource exists or changed. |
NotFoundError |
The server answered 404 Not Found: the resource does not exist. |
PermissionDeniedError |
The server answered 403 Forbidden: the caller may not do this. |
RateLimitError |
The server answered 429 Too Many Requests. |
ServerError |
The server answered with a 5xx status: it failed to do the request. |
UnauthenticatedError |
The server answered 401 Unauthorized: the request has no valid credentials. |
UnityCatalogError |
An error answer of the server, or a request that got no answer. |
class unitycatalog.BadRequestError(message: str,code: str | None = None,status: SupportsIndex | None = None,details: list | None = None,)¶
Bases: UnityCatalogError
The server answered 400 Bad Request: the request is not valid.
class unitycatalog.Client(base_url: str,token: str | None = None,token_provider: Any | None = None,)¶
A client of the API at one base URL.
activate_recipient_token(code: str) → RecipientProfile¶
Open the activation link of a token: the Delta Sharing profile with the bearer token. A link works once, and the request needs no sign-in: the code is the secret. The server keeps a hash of the token only after this.
Returns
- RecipientProfile – A Delta Sharing profile file (
profile.json: what a Delta Sharing client needs to connect to the server as a recipient. The JSON names are lowerCamelCase, as the protocol has them.
Async: activate_recipient_token_async(…) → Future[RecipientProfile]
catalog(catalog_name: str) → CatalogClient¶
The requests on one CatalogInfo. It sends no request itself.
commit_delta(table_id: str,table_uri: str,*,commit_info: DeltaCommitInfo | None = None,latest_backfilled_version: SupportsIndex | None = None,metadata: DeltaMetadata | None = None,uniform: DeltaUniform | None = None,) → None¶
Ratify a staged commit, report backfilled commits, or both. Another commit at the same version is a conflict (status 409).
Parameters
- table_id (str) – Unique identifier of the table to commit to.
- table_uri (str) – Storage location of the table. It must be the location of the table.
- commit_info (DeltaCommitInfo | None, optional) – The commit file to ratify.
- latest_backfilled_version (SupportsIndex | None, optional) – The commits up to this version are backfilled into
_delta_log, so the server stops tracking them. - metadata (DeltaMetadata | None, optional) – A metadata change to apply with the commit. Not with a backfill report alone.
- uniform (DeltaUniform | None, optional) – UniForm metadata to commit with the commit.
Async: commit_delta_async(…) → Future[None]
commit_iceberg_table(catalog: str,namespace: str,table: str,*,identifier: IcebergTableIdentifier | None = None,requirements: SupportsGetItem[int, IcebergTableRequirement] | None = None,updates: SupportsGetItem[int, IcebergTableUpdate] | None = None,) → IcebergLoadTableResponse¶
Commit changes to a native Iceberg table, or create a staged table.
Parameters
- identifier (IcebergTableIdentifier | None, optional) – The table. The server does not read it: the path names the table.
- requirements (SupportsGetItem[int, IcebergTableRequirement] | None, optional) – Conditions that the table must meet for the commit to apply. With
assert-create, the commit creates a staged table. - updates (SupportsGetItem[int, IcebergTableUpdate] | None, optional) – Changes to the metadata, applied in order.
Returns
- IcebergLoadTableResponse – The metadata of a table, with the properties a client needs to read and write its files.
Async: commit_iceberg_table_async(…) → Future[IcebergLoadTableResponse]
create_catalog(name: str,*,comment: str | None = None,properties: dict[str, str] | None = None,storage_root: str | None = None,) → CatalogInfo¶
Create a catalog.
Parameters
- name (str) – Name of the catalog.
- comment (str | None, optional) – User-provided free-form text description.
- properties (dict[str, str] | None, optional) – Key-value properties of the catalog.
- storage_root (str | None, optional) – Storage root URL for the managed storage of the catalog.
Returns
- CatalogInfo – A catalog: the first layer of the three-level namespace. It holds schemas.
Async: create_catalog_async(…) → Future[CatalogInfo]
create_credential(name: str,*,comment: str | None = None,aws_iam_role: AwsIamRoleRequest | None = None,purpose: CredentialPurpose | str | None = None,azure_service_principal: AzureServicePrincipalRequest | None = None,azure_managed_identity: AzureManagedIdentity | None = None,gcp_service_account: GcpServiceAccount | None = None,gcp_service_account_key: GcpServiceAccountKeyRequest | None = None,) → CredentialInfo¶
Create a credential.
Parameters
- name (str) – Name of the credential.
- comment (str | None, optional) – User-provided free-form text description.
- aws_iam_role (AwsIamRoleRequest | None, optional) – The AWS IAM role of the credential. A credential has exactly one of
aws_iam_role,azure_service_principal,azure_managed_identity,gcp_service_accountandgcp_service_account_key. - purpose (CredentialPurpose | str | None, optional) – What the credential is used for.
- azure_service_principal (AzureServicePrincipalRequest | None, optional) – The Azure service principal of the credential.
- azure_managed_identity (AzureManagedIdentity | None, optional) – The Azure managed identity of the credential.
- gcp_service_account (GcpServiceAccount | None, optional) – The GCP service account of the credential.
- gcp_service_account_key (GcpServiceAccountKeyRequest | None, optional) – The GCP service account key of the credential.
Returns
- CredentialInfo – A credential that gives access to storage or to external services.
Async: create_credential_async(…) → Future[CredentialInfo]
create_delta_staging_table(catalog: str,schema: str,name: str,) → DeltaStagingTableResponse¶
Create a staging table: reserve a table id and a storage location for a new MANAGED table, with credentials to write its first commit.
Parameters
- name (str) – Name of the table.
Returns
- DeltaStagingTableResponse – A staging table: the table id and storage location that the server reserves for a new MANAGED table, and what the first commit must contain.
Async: create_delta_staging_table_async(…) → Future[DeltaStagingTableResponse]
create_delta_table(catalog: str,schema: str,name: str,location: str,table_type: DeltaTableType | str,columns: DeltaStructType,protocol: DeltaProtocol,last_commit_timestamp_ms: SupportsIndex,*,comment: str | None = None,partition_columns: SupportsGetItem[int, str] | None = None,properties: dict[str, str] | None = None,domain_metadata: DeltaDomainMetadataUpdates | None = None,uniform: DeltaUniformMetadata | None = None,) → DeltaLoadTableResponse¶
Create a table. A MANAGED table takes over the staging table at its location.
Parameters
- name (str) – Name of the table.
- location (str) – Storage location of the table. For a MANAGED table, the location of its staging table.
- table_type (DeltaTableType | str) – Type of the table.
- columns (DeltaStructType) – The columns of the table. They must hold at least one field.
- protocol (DeltaProtocol) – The Delta protocol of the table.
- last_commit_timestamp_ms (SupportsIndex) – Timestamp of version 0, the commit that the client wrote before the call, in epoch milliseconds.
- comment (str | None, optional) – User-provided free-form text description.
- partition_columns (SupportsGetItem[int, str] | None, optional) – Names of the partition columns.
- properties (dict[str, str] | None, optional) – The Delta table properties.
- domain_metadata (DeltaDomainMetadataUpdates | None, optional) – The domain metadata of the table.
- uniform (DeltaUniformMetadata | None, optional) – UniForm conversion metadata. With it, the table is UniForm-enabled; the client writes the Iceberg metadata file before the call.
Returns
- DeltaLoadTableResponse – A Delta table: its metadata and, for a MANAGED table, its commits that are not backfilled yet.
Async: create_delta_table_async(…) → Future[DeltaLoadTableResponse]
create_directory(directory_path: str) → None¶
Create a directory and its parents. In object storage, a directory exists only through its files, so this only checks the path. Only in volumes; needs ownership of the volume.
Async: create_directory_async(…) → Future[None]
create_external_location(name: str,url: str,credential_name: str,*,comment: str | None = None,) → ExternalLocationInfo¶
Create an external location.
Parameters
- name (str) – Name of the external location.
- url (str) – URL of the storage path, such as
s3://bucket/path. - credential_name (str) – Name of the credential that gives access to the path.
- comment (str | None, optional) – User-provided free-form text description.
Returns
- ExternalLocationInfo – An external location: a storage path and the credential that gives access to it.
Async: create_external_location_async(…) → Future[ExternalLocationInfo]
create_function(function_info: CreateFunction) → FunctionInfo¶
Create a function.
Parameters
- function_info (CreateFunction) – The function to create.
Returns
- FunctionInfo – A function: a user-defined function in the third layer of the three-level namespace, below a schema.
Async: create_function_async(…) → Future[FunctionInfo]
create_group(display_name: str,*,schemas: SupportsGetItem[int, str] | None = None,members: SupportsGetItem[int, ScimGroupMember] | None = None,external_id: str | None = None,) → ScimGroup¶
Create a group. Only the metastore admin can.
Parameters
- display_name (str) – Name of the group, its name in grants.
- schemas (SupportsGetItem[int, str] | None, optional) – SCIM schema URIs of the resource:
urn:ietf:params:scim:schemas:core:2.0:Group. Requests send the key even when empty; the server fills it in. - members (SupportsGetItem[int, ScimGroupMember] | None, optional) – Members of the group: users.
- external_id (str | None, optional) – The identity the group has at an identity provider.
Returns
- ScimGroup – A SCIM 2.0 group of users.
Async: create_group_async(…) → Future[ScimGroup]
create_iceberg_namespace(catalog: str,namespace: SupportsGetItem[int, str],*,properties: dict[str, str] | None = None,) → IcebergNamespaceResponse¶
Create a namespace: a schema of the catalog.
Parameters
- namespace (SupportsGetItem[int, str]) – The levels of the namespace. Exactly one level: the name of the schema to create.
- properties (dict[str, str] | None, optional) – Properties of the namespace.
Returns
- IcebergNamespaceResponse – A namespace and its properties.
Async: create_iceberg_namespace_async(…) → Future[IcebergNamespaceResponse]
create_iceberg_table(catalog: str,namespace: str,name: str,schema: IcebergSchema,*,location: str | None = None,partition_spec: IcebergPartitionSpec | None = None,write_order: IcebergSortOrder | None = None,stage_create: bool | None = None,properties: dict[str, str] | None = None,) → IcebergLoadTableResponse¶
Create a native Iceberg table, or stage its creation.
Parameters
- name (str) – Name of the table.
- schema (IcebergSchema) – Schema of the table. The server assigns fresh ids.
- location (str | None, optional) – Location of the table. With a location the table is EXTERNAL; without one it is MANAGED, at a location that the server picks.
- partition_spec (IcebergPartitionSpec | None, optional) – Partition spec of the table. Unpartitioned when absent.
- write_order (IcebergSortOrder | None, optional) – Sort order of the table. Unsorted when absent.
- stage_create (bool | None, optional) – Return the metadata of the table without creating it. A commit with an
assert- createrequirement creates it. - properties (dict[str, str] | None, optional) – Properties of the table.
format-versionpicks the format version (2 by default) and is not kept.
Returns
- IcebergLoadTableResponse – The metadata of a table, with the properties a client needs to read and write its files.
Async: create_iceberg_table_async(…) → Future[IcebergLoadTableResponse]
create_model_version(model_name: str,catalog_name: str,schema_name: str,source: str,*,run_id: str | None = None,comment: str | None = None,) → ModelVersionInfo¶
Create a model version with the status PENDING_REGISTRATION. The server gives it the next version number and a storage location.
Parameters
- model_name (str) – Name of the parent registered model, relative to its schema.
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
- source (str) – URI of the source files the model version is created from, such as an MLflow run artifact path.
- run_id (str | None, optional) – ID of the run of the ML package that made the model.
- comment (str | None, optional) – User-provided free-form text description.
Returns
- ModelVersionInfo – A version of a registered model. The server gives each new version the next number.
Async: create_model_version_async(…) → Future[ModelVersionInfo]
create_recipient(name: str,*,authentication_type: AuthenticationType | str | None = None,owner: str | None = None,comment: str | None = None,properties_kvpairs: SecurablePropertiesKvPairs | None = None,expiration_time: SupportsIndex | None = None,) → Recipient¶
Create a new recipient.
Parameters
- name (str) – Name of the recipient.
- authentication_type (AuthenticationType | str | None, optional) – The delta sharing authentication type. The server has
TOKENonly, which is the default. - owner (str | None, optional) – Username of the recipient owner. The default is the caller.
- comment (str | None, optional) – Description about the recipient.
- properties_kvpairs (SecurablePropertiesKvPairs | None, optional) – Recipient properties as map of string key-value pairs. When provided in update request, the specified properties will override the existing properties. To add and remove properties, one would need to perform a read- modify-write.
- expiration_time (SupportsIndex | None, optional) – Expiration timestamp of the token, in epoch milliseconds.
Returns
- Recipient – The requested resource
Async: create_recipient_async(…) → Future[Recipient]
create_registered_model(name: str,catalog_name: str,schema_name: str,*,comment: str | None = None,) → RegisteredModelInfo¶
Create a registered model.
Parameters
- name (str) – Name of the registered model, relative to its schema.
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
- comment (str | None, optional) – User-provided free-form text description.
Returns
- RegisteredModelInfo – A registered model: a securable in the three-level namespace (catalog.schema.model) that holds model versions.
Async: create_registered_model_async(…) → Future[RegisteredModelInfo]
create_schema(name: str,catalog_name: str,*,comment: str | None = None,properties: dict[str, str] | None = None,storage_root: str | None = None,) → SchemaInfo¶
Create a schema.
Parameters
- name (str) – Name of the schema, relative to the parent catalog.
- catalog_name (str) – Name of the parent catalog.
- comment (str | None, optional) – User-provided free-form text description.
- properties (dict[str, str] | None, optional) – Key-value properties of the schema.
- storage_root (str | None, optional) – Storage root URL for the managed storage of the schema.
Returns
- SchemaInfo – A schema: the second layer of the three-level namespace. It holds tables, volumes, functions and models.
Async: create_schema_async(…) → Future[SchemaInfo]
create_share(name: str,*,comment: str | None = None,storage_root: str | None = None,) → Share¶
Create a new share.
Parameters
- name (str) – Name of the share.
- comment (str | None, optional) – User-provided free-form text description.
- storage_root (str | None, optional) – Storage root URL for the share.
Returns
- Share – The requested resource
Async: create_share_async(…) → Future[Share]
create_staging_table(name: str,catalog_name: str,schema_name: str,) → StagingTableInfo¶
Create a staging table: reserve a table id and a managed storage location for a MANAGED table.
Parameters
- name (str) – Name of the table, relative to the parent schema.
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
Returns
- StagingTableInfo – A staging table: a table id and managed storage location reserved for a MANAGED table that a client is about to create.
Async: create_staging_table_async(…) → Future[StagingTableInfo]
create_table(name: str,catalog_name: str,schema_name: str,table_type: TableType | str,*,columns: SupportsGetItem[int, ColumnInfo] | None = None,data_source_format: DataSourceFormat | str | None = None,storage_location: str | None = None,comment: str | None = None,properties: dict[str, str] | None = None,view_definition: str | None = None,view_dependencies: DependencyList | None = None,) → TableInfo¶
Create a table.
Parameters
- name (str) – Name of the table, relative to the parent schema.
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
- table_type (TableType | str) – Type of the table.
- columns (SupportsGetItem[int, ColumnInfo] | None, optional) – The columns of the table. Views and metric views need at least one.
- data_source_format (DataSourceFormat | str | None, optional) – File format of the data of the table. MANAGED tables are DELTA; ICEBERG tables come only from the Iceberg REST catalog.
- storage_location (str | None, optional) – Storage location URL of the table. Required for EXTERNAL tables; for MANAGED tables, the
staging_locationof a staging table that the caller created. - comment (str | None, optional) – User-provided free-form text description.
- properties (dict[str, str] | None, optional) – Key-value properties of the table.
- view_definition (str | None, optional) – Definition of a view-like table: SQL for views, YAML for metric views.
- view_dependencies (DependencyList | None, optional) – The tables and functions that a view-like table reads. Required for metric views.
Returns
- TableInfo – A table: data in the third layer of the three-level namespace, below a schema.
Async: create_table_async(…) → Future[TableInfo]
create_token(name: str,*,expires_at: SupportsIndex | None = None,) → PatInfo¶
Create a personal access token for the caller.
Parameters
- name (str) – Name of the token.
- expires_at (SupportsIndex | None, optional) – Time at which the token expires, in epoch milliseconds. Without it the token does not expire.
Returns
- PatInfo – A personal access token of a user. The server keeps a hash of the token only: the token itself is in the response of
CreateTokenand nowhere else.
Async: create_token_async(…) → Future[PatInfo]
create_user(user_name: str,*,external_id: str | None = None,display_name: str | None = None,active: bool | None = None,emails: SupportsGetItem[int, ScimEmail] | None = None,photos: SupportsGetItem[int, ScimPhoto] | None = None,name: ScimName | None = None,) → ScimUser¶
Create a user. Its user name, principal and external id belong to no other user, and no group has its principal as name. Only the metastore admin can.
Parameters
- user_name (str) – The unique name of the user, such as a user principal name, in any case. Absent in a create request: the principal.
- external_id (str | None, optional) – The identity the user has at an identity provider. An application's own token names the user whose external id is the name of the issuer block and the client id, such as
entra:<client id>. - display_name (str | None, optional) – Name of the user, for display.
- active (bool | None, optional) – Whether the user can sign in. Absent: enabled; a new user without it gets
true. - emails (SupportsGetItem[int, ScimEmail] | None, optional) – Email addresses of the user. When the principal changes, the grants, owned objects and tokens of the user move to the new one.
- photos (SupportsGetItem[int, ScimPhoto] | None, optional) – Pictures of the user.
- name (ScimName | None, optional) – The parts of the name of the user.
Returns
- ScimUser – A SCIM 2.0 user. Its principal, its name in grants and owners, is its primary email, else its first email, else its user name.
Async: create_user_async(…) → Future[ScimUser]
create_volume(catalog_name: str,schema_name: str,name: str,volume_type: VolumeType | str,*,comment: str | None = None,storage_location: str | None = None,) → VolumeInfo¶
Create a volume.
Parameters
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
- name (str) – Name of the volume, relative to the parent schema.
- volume_type (VolumeType | str) – Type of the volume.
- comment (str | None, optional) – User-provided free-form text description.
- storage_location (str | None, optional) – Storage location URL of the volume. Required for EXTERNAL volumes; not allowed for MANAGED volumes.
Returns
- VolumeInfo – A volume: files in the third layer of the three-level namespace, below a schema.
Async: create_volume_async(…) → Future[VolumeInfo]
credential(credential_name: str) → CredentialClient¶
The requests on one CredentialInfo. It sends no request itself.
delete_delta_table(catalog: str,schema: str,table: str,) → None¶
Delete a table.
Async: delete_delta_table_async(…) → Future[None]
delete_directory(directory_path: str,*,recursive: bool | None = None,) → None¶
Delete a directory: an empty one, or with recursive, one and what it holds. Only in volumes; needs
ownership of the volume.
Parameters
- recursive (bool | None, optional) – Also delete the files and directories in it. Without it, a directory that holds anything is an error. Not in the Databricks Files API.
Async: delete_directory_async(…) → Future[None]
delete_file(file_path: str) → None¶
Delete a file. Only in volumes; needs ownership of the volume.
Async: delete_file_async(…) → Future[None]
delete_group(id: str) → None¶
Delete a group. Only the metastore admin can.
Async: delete_group_async(…) → Future[None]
delete_model_version(full_name: str, version: SupportsIndex) → None¶
Delete a model version.
Async: delete_model_version_async(…) → Future[None]
delete_user(id: str) → None¶
Delete a user with its grants, tokens and group memberships. Only the metastore admin can.
Async: delete_user_async(…) → Future[None]
delta_table_exists(catalog: str,schema: str,table: str,) → bool¶
Check that a table exists. A missing table is status 404.
Async: delta_table_exists_async(…) → Future[bool]
download_file(file_path: str,*,range: str | None = None,) → DownloadFileResponse¶
Read a file, or a range of its bytes. Needs READ VOLUME on a volume, or SELECT on a table.
Parameters
- range (str | None, optional) – The bytes to read, as an HTTP
Rangeheader has them:bytes=0-1023,bytes=1024-orbytes=-1024. The answer is then status 206, with those bytes.
Returns
- DownloadFileResponse – A file and its metadata.
Async: download_file_async(…) → Future[DownloadFileResponse]
drop_iceberg_namespace(catalog: str, namespace: str) → None¶
Drop a namespace. It must be empty.
Async: drop_iceberg_namespace_async(…) → Future[None]
drop_iceberg_table(catalog: str,namespace: str,table: str,*,purge_requested: bool | None = None,) → None¶
Drop a native Iceberg table. UniForm tables are dropped through the Unity Catalog API.
Parameters
- purge_requested (bool | None, optional) – Whether to delete the data too. Checked, but without effect: the files of a MANAGED table are always removed, those of an EXTERNAL table never.
Async: drop_iceberg_table_async(…) → Future[None]
exchange_token(grant_type: str,requested_token_type: str,subject_token: str,subject_token_type: str,*,scope: str | None = None,actor_token: str | None = None,actor_token_type: str | None = None,) → OAuthTokenExchangeInfo¶
Exchange a token of an identity provider for a Unity Catalog access token (OAuth 2.0 token exchange, RFC 8693). It needs no sign-in.
Parameters
- grant_type (str) – The grant type:
urn:ietf:params:oauth:grant-type:token-exchange. - requested_token_type (str) – The type of the token to issue:
urn:ietf:params:oauth:token- type:access_token. - subject_token (str) – The token of the identity provider that names the user, such as an ID token.
- subject_token_type (str) – The type of
subject_token, such asurn:ietf:params:oauth:token- type:id_token. - scope (str | None, optional) – The scope of the token exchange.
- actor_token (str | None, optional) – The token of the acting party. Not supported.
- actor_token_type (str | None, optional) – The type of
actor_token. Not supported: the server refuses a request with it.
Returns
- OAuthTokenExchangeInfo – An OAuth 2.0 token exchange response (RFC 8693: a Unity Catalog access token.
Async: exchange_token_async(…) → Future[OAuthTokenExchangeInfo]
external_location(external_location_name: str) → ExternalLocationClient¶
The requests on one ExternalLocationInfo. It sends no request itself.
finalize_model_version(full_name: str, version: SupportsIndex) → ModelVersionInfo¶
Finalize a model version: its status changes from PENDING_REGISTRATION to READY after the client wrote all its files.
Returns
- ModelVersionInfo – A version of a registered model. The server gives each new version the next number.
Async: finalize_model_version_async(…) → Future[ModelVersionInfo]
function(function_name: str) → FunctionClient¶
The requests on one FunctionInfo. It sends no request itself.
generate_temporary_model_version_credentials(catalog_name: str,schema_name: str,model_name: str,version: SupportsIndex,operation: ModelVersionOperation | str,) → TemporaryCredentials¶
Generate temporary credentials for the storage of a model version.
Parameters
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
- model_name (str) – Name of the registered model, relative to its schema.
- version (SupportsIndex) – Number of the model version.
- operation (ModelVersionOperation | str) – The operation on the model version.
Returns
- TemporaryCredentials – Temporary credentials for the cloud of a storage location. Empty for a local
file:location.
Async: generate_temporary_model_version_credentials_async(…) → Future[TemporaryCredentials]
generate_temporary_path_credentials(url: str, operation: PathOperation | str) → TemporaryCredentials¶
Generate temporary credentials for a storage path.
Parameters
- url (str) – URL of the storage path.
- operation (PathOperation | str) – The operation on the path.
Returns
- TemporaryCredentials – Temporary credentials for the cloud of a storage location. Empty for a local
file:location.
Async: generate_temporary_path_credentials_async(…) → Future[TemporaryCredentials]
generate_temporary_table_credentials(table_id: str, operation: TableOperation | str) → TemporaryCredentials¶
Generate temporary credentials for the storage of a table.
Parameters
- table_id (str) – Unique identifier of the table.
- operation (TableOperation | str) – The operation on the table.
Returns
- TemporaryCredentials – Temporary credentials for the cloud of a storage location. Empty for a local
file:location.
Async: generate_temporary_table_credentials_async(…) → Future[TemporaryCredentials]
generate_temporary_volume_credentials(volume_id: str, operation: VolumeOperation | str) → TemporaryCredentials¶
Generate temporary credentials for the storage of a volume.
Parameters
- volume_id (str) – Unique identifier of the volume.
- operation (VolumeOperation | str) – The operation on the volume.
Returns
- TemporaryCredentials – Temporary credentials for the cloud of a storage location. Empty for a local
file:location.
Async: generate_temporary_volume_credentials_async(…) → Future[TemporaryCredentials]
get_auth_mode() → AuthMode¶
Get how the web UI signs in. It needs no sign-in.
Returns
- AuthMode – How the web UI signs in, and where its "Log out" goes.
Async: get_auth_mode_async(…) → Future[AuthMode]
get_backup() → BackupResponse¶
Get a snapshot of the whole catalog, in one answer.
Returns
- BackupResponse – A snapshot of the whole catalog: the rows of each table of the store. The audit log is not in it.
Async: get_backup_async(…) → Future[BackupResponse]
get_delta_commits(table_id: str,start_version: SupportsIndex,*,table_uri: str | None = None,end_version: SupportsIndex | None = None,) → DeltaGetCommitsResponse¶
Get the commits of a table that are not backfilled yet. The server takes the request as the JSON
body of a GET.
Parameters
- table_id (str) – Unique identifier of the table.
- start_version (SupportsIndex) – First version to return (inclusive). It must be 0 or more.
- table_uri (str | None, optional) – Storage location of the table.
- end_version (SupportsIndex | None, optional) – Last version to return (inclusive). It does not change
latest_table_version.
Returns
- DeltaGetCommitsResponse – The commits that the server tracks for a table.
Async: get_delta_commits_async(…) → Future[DeltaGetCommitsResponse]
get_delta_config(catalog: str, protocol_versions: str) → DeltaCatalogConfig¶
Get the configuration of the Delta API for a catalog: the endpoints that the server supports and the protocol version.
Parameters
- catalog (str) – Name of the catalog.
- protocol_versions (str) – The highest protocol versions that the client supports per major version, comma-separated, such as
1.0or1.1,2.3. The server answers with the highest version that both support.
Returns
- DeltaCatalogConfig – The configuration of the Delta API for a catalog.
Async: get_delta_config_async(…) → Future[DeltaCatalogConfig]
get_delta_staging_table_credentials(table_id: str) → DeltaCredentialsResponse¶
Get temporary credentials for the data of a staging table. They are always READ_WRITE, for the
first commit. Only the owner of the staging table gets them.
Returns
- DeltaCredentialsResponse – Temporary credentials for the data of a table.
Async: get_delta_staging_table_credentials_async(…) → Future[DeltaCredentialsResponse]
get_delta_table_credentials(catalog: str,schema: str,table: str,operation: DeltaCredentialOperation | str,) → DeltaCredentialsResponse¶
Get temporary credentials for the data of a table.
Parameters
- operation (DeltaCredentialOperation | str) – The access level of the credentials.
Returns
- DeltaCredentialsResponse – Temporary credentials for the data of a table.
Async: get_delta_table_credentials_async(…) → Future[DeltaCredentialsResponse]
get_directory_metadata(directory_path: str) → bool¶
Check that a directory exists. A missing directory is status 404.
Async: get_directory_metadata_async(…) → Future[bool]
get_file_metadata(file_path: str) → GetFileMetadataResponse¶
Get the metadata of a file. Needs READ VOLUME on a volume, or SELECT on a table.
Returns
- GetFileMetadataResponse – The metadata of a file. The response has no body.
Async: get_file_metadata_async(…) → Future[GetFileMetadataResponse]
get_group(id: str,*,attributes: str | None = None,excluded_attributes: str | None = None,) → ScimGroup¶
Get a group. Only the metastore admin can.
Parameters
- attributes (str | None, optional) – The only attributes to return, separated by commas.
- excluded_attributes (str | None, optional) – The attributes to leave out, separated by commas.
Returns
- ScimGroup – A SCIM 2.0 group of users.
Async: get_group_async(…) → Future[ScimGroup]
get_health() → HealthResponse¶
Check that the server answers. The database is not asked.
Returns
- HealthResponse – The state of the server.
Async: get_health_async(…) → Future[HealthResponse]
get_iceberg_config(warehouse: str) → IcebergConfigResponse¶
Get the client configuration of a catalog.
Parameters
- warehouse (str) – Name of the catalog: the Iceberg warehouse.
Returns
- IcebergConfigResponse – The client configuration of a catalog.
Async: get_iceberg_config_async(…) → Future[IcebergConfigResponse]
get_me() → ScimUser¶
Get the signed-in user. The role admin names a caller that can do what the metastore admin does.
Returns
- ScimUser – A SCIM 2.0 user. Its principal, its name in grants and owners, is its primary email, else its first email, else its user name.
Async: get_me_async(…) → Future[ScimUser]
get_metastore_summary() → GetMetastoreSummaryResponse¶
Get a summary of the metastore.
Returns
- GetMetastoreSummaryResponse – A summary of the metastore of the server.
Async: get_metastore_summary_async(…) → Future[GetMetastoreSummaryResponse]
get_model_version(full_name: str, version: SupportsIndex) → ModelVersionInfo¶
Get a model version.
Returns
- ModelVersionInfo – A version of a registered model. The server gives each new version the next number.
Async: get_model_version_async(…) → Future[ModelVersionInfo]
get_permissions(securable_type: str,full_name: str,*,principal: str | None = None,) → PermissionsList¶
Get the privileges on a securable.
Parameters
- principal (str | None, optional) – Return only the privileges of this principal.
Returns
- PermissionsList – The privileges on a securable, per principal.
Async: get_permissions_async(…) → Future[PermissionsList]
get_scim_resource_type(id: str) → ScimResourceType¶
Get a SCIM resource type of the server. Any signed-in caller can.
Returns
- ScimResourceType – A SCIM resource type (RFC 7643, section 6).
Async: get_scim_resource_type_async(…) → Future[ScimResourceType]
get_scim_schema(id: str) → ScimSchema¶
Get a SCIM schema of the server. Any signed-in caller can.
Returns
- ScimSchema – A SCIM schema (RFC 7643, section 7).
Async: get_scim_schema_async(…) → Future[ScimSchema]
get_service_provider_config() → ScimServiceProviderConfig¶
Get the SCIM features that the server supports. Any signed-in caller can.
Returns
- ScimServiceProviderConfig – The SCIM features that the server supports (RFC 7643, section 5).
Async: get_service_provider_config_async(…) → Future[ScimServiceProviderConfig]
get_user(id: str,*,attributes: str | None = None,excluded_attributes: str | None = None,) → ScimUser¶
Get a user. Only the metastore admin can.
Parameters
- attributes (str | None, optional) – The only attributes to return, separated by commas.
- excluded_attributes (str | None, optional) – The attributes to leave out, separated by commas.
Returns
- ScimUser – A SCIM 2.0 user. Its principal, its name in grants and owners, is its primary email, else its first email, else its user name.
Async: get_user_async(…) → Future[ScimUser]
get_version() → VersionResponse¶
Get the version of the server.
Returns
- VersionResponse – The server and its versions.
Async: get_version_async(…) → Future[VersionResponse]
iceberg_namespace_exists(catalog: str, namespace: str) → bool¶
Check that a namespace exists. A namespace that does not exist is a not-found error.
Async: iceberg_namespace_exists_async(…) → Future[bool]
iceberg_table_exists(catalog: str,namespace: str,table: str,) → bool¶
Check that a table exists. A table that does not exist is a not-found error.
Async: iceberg_table_exists_async(…) → Future[bool]
list_audit_events(*,principal: str | None = None,method: str | None = None,path_prefix: str | None = None,since: SupportsIndex | None = None,until: SupportsIndex | None = None,max_results: SupportsIndex | None = None,page_token: str | None = None,) → ListAuditEventsResponse¶
List the audit events, newest first.
Parameters
- principal (str | None, optional) – Return only the events of this principal.
- method (str | None, optional) – Return only the events of this HTTP method, such as
DELETE. - path_prefix (str | None, optional) – Return only the events whose path starts with this prefix.
- since (SupportsIndex | None, optional) – Return only the events at or after this time, in epoch milliseconds.
- until (SupportsIndex | None, optional) – Return only the events at or before this time, in epoch milliseconds.
- max_results (SupportsIndex | None, optional) – The maximum number of events to return.
- page_token (str | None, optional) – Opaque token of the page to return: the
next_page_tokenof the page before.
Returns
- ListAuditEventsResponse – The requested resource
Async: list_audit_events_async(…) → Future[ListAuditEventsResponse]
list_catalogs(*,max_results: SupportsIndex | None = None,include_browse: bool | None = None,) → list[CatalogInfo]¶
List the catalogs that the caller can see.
Parameters
- max_results (SupportsIndex | None, optional) – The maximum number of catalogs to return.
- include_browse (bool | None, optional) – Also return the catalogs that the caller sees through the
BROWSEprivilege only, with their discovery fields andbrowse_onlyset.
Returns
- list[CatalogInfo] – The catalogs.
Async: list_catalogs_async(…) → Future[list[CatalogInfo]]
list_credentials(*,max_results: SupportsIndex | None = None,purpose: CredentialPurpose | str | None = None,) → list[CredentialInfo]¶
List the credentials that the caller can see.
Parameters
- max_results (SupportsIndex | None, optional) – The maximum number of credentials to return.
- purpose (CredentialPurpose | str | None, optional) – Return only the credentials with this purpose.
Returns
- list[CredentialInfo] – The credentials.
Async: list_credentials_async(…) → Future[list[CredentialInfo]]
list_directory_contents(directory_path: str,*,page_size: SupportsIndex | None = None,page_token: str | None = None,) → ListDirectoryContentsResponse¶
List the files and directories of a directory. Needs READ VOLUME on a volume, or SELECT on
a table.
Parameters
- page_size (SupportsIndex | None, optional) – The maximum number of entries to return. The server returns at most 1000.
- page_token (str | None, optional) – Opaque token of the page to return: the
next_page_tokenof the page before.
Returns
- ListDirectoryContentsResponse – The requested resource
Async: list_directory_contents_async(…) → Future[ListDirectoryContentsResponse]
list_external_locations(*,max_results: SupportsIndex | None = None,include_browse: bool | None = None,) → list[ExternalLocationInfo]¶
List the external locations that the caller can see.
Parameters
- max_results (SupportsIndex | None, optional) – The maximum number of external locations to return.
- include_browse (bool | None, optional) – Also return the external locations that the caller sees through the
BROWSEprivilege only, with their discovery fields andbrowse_onlyset.
Returns
- list[ExternalLocationInfo] – The external locations.
Async: list_external_locations_async(…) → Future[list[ExternalLocationInfo]]
list_functions(catalog_name: str,schema_name: str,*,max_results: SupportsIndex | None = None,include_browse: bool | None = None,) → list[FunctionInfo]¶
List the functions of a schema that the caller can see.
Parameters
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
- max_results (SupportsIndex | None, optional) – The maximum number of functions to return.
- include_browse (bool | None, optional) – Also return the functions that the caller sees through the
BROWSEprivilege only, with their discovery fields andbrowse_onlyset.
Returns
- list[FunctionInfo] – The functions.
Async: list_functions_async(…) → Future[list[FunctionInfo]]
list_groups(*,filter: str | None = None,start_index: SupportsIndex | None = None,count: SupportsIndex | None = None,attributes: str | None = None,excluded_attributes: str | None = None,) → ListScimGroupsResponse¶
List the groups. Only the metastore admin can.
Parameters
- filter (str | None, optional) – SCIM filter (RFC 7644, section 3.4.2.2), such as
displayName eq "admins". - start_index (SupportsIndex | None, optional) – Index of the first group to return, from 1.
- count (SupportsIndex | None, optional) – The maximum number of groups to return, at most 1000. The default is 50.
- attributes (str | None, optional) – The only attributes to return, separated by commas, such as
displayName. - excluded_attributes (str | None, optional) – The attributes to leave out, separated by commas, such as
members.
Returns
- ListScimGroupsResponse – A page of SCIM groups.
Async: list_groups_async(…) → Future[ListScimGroupsResponse]
list_iceberg_namespaces(catalog: str,*,parent: str | None = None,page_token: str | None = None,page_size: SupportsIndex | None = None,) → IcebergListNamespacesResponse¶
List the namespaces of a catalog: its schemas that the caller can read.
Parameters
- parent (str | None, optional) – Parent namespace. Namespaces are not nested: a parent that exists has no children, a parent that does not exist is not found. An empty value is no parent.
- page_token (str | None, optional) – Opaque token of the page to return: the
next-page-tokenof the page before. An empty token asks for the first page. Without a token the answer is the whole listing. - page_size (SupportsIndex | None, optional) – The maximum number of namespaces in a page, at least 1; a larger value than 100 counts as 100. Read only with a page token.
Returns
- IcebergListNamespacesResponse – A page of namespaces.
Async: list_iceberg_namespaces_async(…) → Future[IcebergListNamespacesResponse]
list_iceberg_tables(catalog: str,namespace: str,*,page_token: str | None = None,page_size: SupportsIndex | None = None,) → IcebergListTablesResponse¶
List the tables of a namespace that have Iceberg metadata and that the caller can read.
Parameters
- page_token (str | None, optional) – Opaque token of the page to return: the
next-page-tokenof the page before. An empty token asks for the first page. Without a token the answer is the whole listing. - page_size (SupportsIndex | None, optional) – The maximum number of tables in a page, at least 1; a larger value than 100 counts as 100. Read only with a page token.
Returns
- IcebergListTablesResponse – A page of tables: the tables of a namespace that have Iceberg metadata.
Async: list_iceberg_tables_async(…) → Future[IcebergListTablesResponse]
list_model_versions(full_name: str,*,max_results: SupportsIndex | None = None,) → list[ModelVersionInfo]¶
List the versions of a registered model.
Parameters
- max_results (SupportsIndex | None, optional) – The maximum number of model versions to return.
Returns
- list[ModelVersionInfo] – The model versions.
Async: list_model_versions_async(…) → Future[list[ModelVersionInfo]]
list_recipients(*, max_results: SupportsIndex | None = None) → list[Recipient]¶
List recipients.
Parameters
- max_results (SupportsIndex | None, optional) – The maximum number of results per page that should be returned. If unset or 0, the server's default page size is used. Negative values are rejected.
Returns
- list[Recipient] – List of recipients.
Async: list_recipients_async(…) → Future[list[Recipient]]
list_registered_models(*,catalog_name: str | None = None,schema_name: str | None = None,max_results: SupportsIndex | None = None,include_browse: bool | None = None,) → list[RegisteredModelInfo]¶
List the registered models that the caller can see, of a catalog or schema when given.
Parameters
- catalog_name (str | None, optional) – Name of the catalog whose registered models to return.
- schema_name (str | None, optional) – Name of the schema whose registered models to return.
- max_results (SupportsIndex | None, optional) – The maximum number of registered models to return.
- include_browse (bool | None, optional) – Also return the registered models that the caller sees through the
BROWSEprivilege only, with their discovery fields andbrowse_onlyset.
Returns
- list[RegisteredModelInfo] – The registered models.
Async: list_registered_models_async(…) → Future[list[RegisteredModelInfo]]
list_schemas(catalog_name: str,*,max_results: SupportsIndex | None = None,include_browse: bool | None = None,) → list[SchemaInfo]¶
List the schemas of a catalog that the caller can see.
Parameters
- catalog_name (str) – Name of the parent catalog.
- max_results (SupportsIndex | None, optional) – The maximum number of schemas to return.
- include_browse (bool | None, optional) – Also return the schemas that the caller sees through the
BROWSEprivilege only, with their discovery fields andbrowse_onlyset.
Returns
- list[SchemaInfo] – The schemas.
Async: list_schemas_async(…) → Future[list[SchemaInfo]]
list_scim_resource_types() → ListScimResourceTypesResponse¶
List the SCIM resource types of the server: User and Group. Any signed-in caller can.
Returns
- ListScimResourceTypesResponse – The SCIM resource types of the server, User and Group, as a SCIM list (RFC 7644, section 4).
Async: list_scim_resource_types_async(…) → Future[ListScimResourceTypesResponse]
list_scim_schemas() → ListScimSchemasResponse¶
List the SCIM schemas of the server: User and Group. Any signed-in caller can.
Returns
- ListScimSchemasResponse – The SCIM schemas of the server, User and Group, as a SCIM list (RFC 7644, section 4).
Async: list_scim_schemas_async(…) → Future[ListScimSchemasResponse]
list_shares(*, max_results: SupportsIndex | None = None) → list[Share]¶
List shares.
Parameters
- max_results (SupportsIndex | None, optional) – The maximum number of results per page that should be returned. If unset or 0, the server's default page size is used. Negative values are rejected.
Returns
- list[Share] – List of shares.
Async: list_shares_async(…) → Future[list[Share]]
list_tables(catalog_name: str,schema_name: str,*,max_results: SupportsIndex | None = None,include_browse: bool | None = None,) → list[TableInfo]¶
List the tables of a schema that the caller can see.
Parameters
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
- max_results (SupportsIndex | None, optional) – The maximum number of tables to return.
- include_browse (bool | None, optional) – Also return the tables that the caller sees through the
BROWSEprivilege only, with their discovery fields andbrowse_onlyset.
Returns
- list[TableInfo] – The tables.
Async: list_tables_async(…) → Future[list[TableInfo]]
list_tokens(*, max_results: SupportsIndex | None = None) → list[PatInfo]¶
List the personal access tokens of the caller.
Parameters
- max_results (SupportsIndex | None, optional) – The maximum number of tokens to return.
Returns
- list[PatInfo] – The tokens.
Async: list_tokens_async(…) → Future[list[PatInfo]]
list_users(*,filter: str | None = None,start_index: SupportsIndex | None = None,count: SupportsIndex | None = None,attributes: str | None = None,excluded_attributes: str | None = None,) → ListScimUsersResponse¶
List the users. Only the metastore admin can.
Parameters
- filter (str | None, optional) – SCIM filter (RFC 7644, section 3.4.2.2), such as
userName eq "a@example.com". - start_index (SupportsIndex | None, optional) – Index of the first user to return, from 1.
- count (SupportsIndex | None, optional) – The maximum number of users to return, at most 1000. The default is 50.
- attributes (str | None, optional) – The only attributes to return, separated by commas, such as
userName,emails.value. - excluded_attributes (str | None, optional) – The attributes to leave out, separated by commas, such as
emails.
Returns
- ListScimUsersResponse – A page of SCIM users.
Async: list_users_async(…) → Future[ListScimUsersResponse]
list_volumes(catalog_name: str,schema_name: str,*,max_results: SupportsIndex | None = None,include_browse: bool | None = None,) → list[VolumeInfo]¶
List the volumes of a schema that the caller can see.
Parameters
- catalog_name (str) – Name of the parent catalog.
- schema_name (str) – Name of the parent schema.
- max_results (SupportsIndex | None, optional) – The maximum number of volumes to return.
- include_browse (bool | None, optional) – Also return the volumes that the caller sees through the
BROWSEprivilege only, with their discovery fields andbrowse_onlyset.
Returns
- list[VolumeInfo] – The volumes.
Async: list_volumes_async(…) → Future[list[VolumeInfo]]
load_delta_table(catalog: str,schema: str,table: str,) → DeltaLoadTableResponse¶
Load a table: its metadata and, for a MANAGED table, its commits that are not backfilled yet. It holds no credentials.
Returns
- DeltaLoadTableResponse – A Delta table: its metadata and, for a MANAGED table, its commits that are not backfilled yet.
Async: load_delta_table_async(…) → Future[DeltaLoadTableResponse]
load_iceberg_namespace(catalog: str, namespace: str) → IcebergNamespaceResponse¶
Get a namespace and its properties.
Returns
- IcebergNamespaceResponse – A namespace and its properties.
Async: load_iceberg_namespace_async(…) → Future[IcebergNamespaceResponse]
load_iceberg_table(catalog: str,namespace: str,table: str,*,snapshots: str | None = None,) → IcebergLoadTableResponse¶
Get the metadata of a table, with credentials for its files.
Parameters
- snapshots (str | None, optional) – The snapshots to return:
all(the default) orrefs, the snapshots that a branch or tag points at.
Returns
- IcebergLoadTableResponse – The metadata of a table, with the properties a client needs to read and write its files.
Async: load_iceberg_table_async(…) → Future[IcebergLoadTableResponse]
load_iceberg_table_credentials(catalog: str,namespace: str,table: str,) → IcebergLoadCredentialsResponse¶
Get fresh credentials for the files of a table.
Returns
- IcebergLoadCredentialsResponse – Fresh credentials for the files of a table.
Async: load_iceberg_table_credentials_async(…) → Future[IcebergLoadCredentialsResponse]
load_iceberg_view(catalog: str,namespace: str,view: str,) → None¶
Get a view. Views are not served: the answer is always a not-found error.
Async: load_iceberg_view_async(…) → Future[None]
logout() → None¶
Sign out: expire the UC_TOKEN cookie of the request, if any.
Async: logout_async(…) → Future[None]
patch_group(id: str,operations: SupportsGetItem[int, ScimPatchOperation],*,schemas: SupportsGetItem[int, str] | None = None,) → ScimGroup¶
Change a group with add, replace and remove operations (RFC 7644, section 3.5.2), such as an
add to members or a remove of members[value eq "<id>"]. Only the metastore admin can.
Parameters
- operations (SupportsGetItem[int, ScimPatchOperation]) – The operations, in order.
- schemas (SupportsGetItem[int, str] | None, optional) – SCIM schema URIs of the request:
urn:ietf:params:scim:api:messages:2.0:PatchOp.
Returns
- ScimGroup – A SCIM 2.0 group of users.
Async: patch_group_async(…) → Future[ScimGroup]
patch_user(id: str,operations: SupportsGetItem[int, ScimPatchOperation],*,schemas: SupportsGetItem[int, str] | None = None,) → ScimUser¶
Change a user with add, replace and remove operations (RFC 7644, section 3.5.2). Operations
on attributes that the server does not keep change nothing; userName cannot be removed. Only the
metastore admin can.
Parameters
- operations (SupportsGetItem[int, ScimPatchOperation]) – The operations, in order.
- schemas (SupportsGetItem[int, str] | None, optional) – SCIM schema URIs of the request:
urn:ietf:params:scim:api:messages:2.0:PatchOp.
Returns
- ScimUser – A SCIM 2.0 user. Its principal, its name in grants and owners, is its primary email, else its first email, else its user name.
Async: patch_user_async(…) → Future[ScimUser]
recipient(recipient_name: str) → RecipientClient¶
The requests on one Recipient. It sends no request itself.
registered_model(registered_model_name: str) → RegisteredModelClient¶
The requests on one RegisteredModelInfo. It sends no request itself.
rename_delta_table(catalog: str,schema: str,table: str,new_name: str,) → None¶
Rename a table in its schema.
Parameters
- new_name (str) – New name of the table, in the same schema.
Async: rename_delta_table_async(…) → Future[None]
rename_iceberg_table(catalog: str,source: IcebergTableIdentifier,destination: IcebergTableIdentifier,) → None¶
Rename a native Iceberg table, in its namespace. A move to another namespace is not supported.
Parameters
- source (IcebergTableIdentifier) – The table to rename.
- destination (IcebergTableIdentifier) – The new name of the table, in the same namespace.
Async: rename_iceberg_table_async(…) → Future[None]
replace_group(id: str,display_name: str,*,schemas: SupportsGetItem[int, str] | None = None,members: SupportsGetItem[int, ScimGroupMember] | None = None,external_id: str | None = None,) → ScimGroup¶
Replace the attributes of a group that the body has: a value replaces, null removes, an absent
attribute stays. The body needs displayName. A renamed group keeps its grants. Only the metastore
admin can.
Parameters
- display_name (str) – Name of the group, its name in grants.
- schemas (SupportsGetItem[int, str] | None, optional) – SCIM schema URIs of the resource:
urn:ietf:params:scim:schemas:core:2.0:Group. Requests send the key even when empty; the server fills it in. - members (SupportsGetItem[int, ScimGroupMember] | None, optional) – Members of the group: users.
- external_id (str | None, optional) – The identity the group has at an identity provider.
Returns
- ScimGroup – A SCIM 2.0 group of users.
Async: replace_group_async(…) → Future[ScimGroup]
replace_user(id: str,user_name: str,*,external_id: str | None = None,display_name: str | None = None,active: bool | None = None,emails: SupportsGetItem[int, ScimEmail] | None = None,photos: SupportsGetItem[int, ScimPhoto] | None = None,name: ScimName | None = None,) → ScimUser¶
Replace the attributes of a user that the body has: a value replaces, null removes, an absent
attribute stays. The body needs userName. Only the metastore admin can.
Parameters
- user_name (str) – The unique name of the user, such as a user principal name, in any case. Absent in a create request: the principal.
- external_id (str | None, optional) – The identity the user has at an identity provider. An application's own token names the user whose external id is the name of the issuer block and the client id, such as
entra:<client id>. - display_name (str | None, optional) – Name of the user, for display.
- active (bool | None, optional) – Whether the user can sign in. Absent: enabled; a new user without it gets
true. - emails (SupportsGetItem[int, ScimEmail] | None, optional) – Email addresses of the user. When the principal changes, the grants, owned objects and tokens of the user move to the new one.
- photos (SupportsGetItem[int, ScimPhoto] | None, optional) – Pictures of the user.
- name (ScimName | None, optional) – The parts of the name of the user.
Returns
- ScimUser – A SCIM 2.0 user. Its principal, its name in grants and owners, is its primary email, else its first email, else its user name.
Async: replace_user_async(…) → Future[ScimUser]
report_delta_table_metrics(catalog: str,schema: str,table: str,table_id: str,*,report: DeltaMetricsReport | None = None,) → None¶
Report the metrics of a commit. The server checks the table id and does not store the metrics.
Parameters
- table_id (str) – Unique identifier of the table. It must be the id of the table in the path.
- report (DeltaMetricsReport | None, optional) – The metrics. The server accepts them and does not store them.
Async: report_delta_table_metrics_async(…) → Future[None]
report_iceberg_metrics(catalog: str,namespace: str,table: str,report_type: str,*,table_name: str | None = None,snapshot_id: SupportsIndex | None = None,filter: Any | None = None,schema_id: SupportsIndex | None = None,projected_field_ids: SupportsGetItem[int, SupportsIndex] | None = None,projected_field_names: SupportsGetItem[int, str] | None = None,sequence_number: SupportsIndex | None = None,operation: str | None = None,metrics: Any | None = None,metadata: dict[str, str] | None = None,) → None¶
Send a scan or commit report of a table. The server checks it and does not keep it.
Parameters
- report_type (str) – The type of report:
scan-reportorcommit-report. - table_name (str | None, optional) – Full name of the table.
- snapshot_id (SupportsIndex | None, optional) – Id of the snapshot that was scanned or committed.
- filter (Any | None, optional) –
scan-report: the filter of the scan, an Iceberg expression (true,false, or an expression object). - schema_id (SupportsIndex | None, optional) –
scan-report: id of the schema of the scan. - projected_field_ids (SupportsGetItem[int, SupportsIndex] | None, optional) –
scan-report: ids of the projected fields. Always sent. - projected_field_names (SupportsGetItem[int, str] | None, optional) –
scan-report: names of the projected fields. Always sent. - sequence_number (SupportsIndex | None, optional) –
commit-report: sequence number of the commit. - operation (str | None, optional) –
commit-report: the operation of the commit, such asappend. - metrics (Any | None, optional) – The metrics, by name: counters (
unit,value) and timers (time-unit,count,total- duration). - metadata (dict[str, str] | None, optional) – Other properties of the report.
Async: report_iceberg_metrics_async(…) → Future[None]
request_access_token(grant_type: str,client_secret: str,*,client_id: str | None = None,scope: str | None = None,) → TokenResponse¶
Get an access token for a personal access token: the OAuth 2.0 client_credentials grant (RFC 6749,
section 4.4). It needs no sign-in.
Parameters
- grant_type (str) – The grant type:
client_credentials. - client_secret (str) – The personal access token.
- client_id (str | None, optional) – The
idof the personal access token. When given, it must name the token ofclient_secret, andexpires_inis the time until that token expires. - scope (str | None, optional) – The scope of the request. The answer repeats it.
Returns
- TokenResponse – An OAuth 2.0 token response (RFC 6749, section 5.1). The access token is the personal access token itself.
Async: request_access_token_async(…) → Future[TokenResponse]
restore_backup(version: SupportsIndex, tables: Any) → RestoreResponse¶
Replace the whole catalog with a snapshot, in one transaction: every table of the store is emptied, then filled with the rows of the snapshot.
Parameters
- version (SupportsIndex) – Version of the snapshot format. A restore takes only version 1.
- tables (Any) – The rows of each table, by table name. A row is a JSON object of its columns, as the table of the store has them.
Returns
- RestoreResponse – What a restore imported.
Async: restore_backup_async(…) → Future[RestoreResponse]
schema(schema_name: str) → SchemaClient¶
The requests on one SchemaInfo. It sends no request itself.
scim_bulk(*,schemas: SupportsGetItem[int, str] | None = None,fail_on_errors: SupportsIndex | None = None,operations: SupportsGetItem[int, ScimBulkOp] | None = None,) → ScimBulkResponse¶
Run operations on users and groups in one request. Each operation has its own status. Only the metastore admin can.
Parameters
- schemas (SupportsGetItem[int, str] | None, optional) – SCIM schema URIs of the request:
urn:ietf:params:scim:api:messages:2.0:BulkRequest. - fail_on_errors (SupportsIndex | None, optional) – Stop after this many operations failed. Absent: run every operation.
- operations (SupportsGetItem[int, ScimBulkOp] | None, optional) – The operations, in order. At most 100.
Returns
- ScimBulkResponse – The answer to a SCIM bulk request: one result per operation that ran, in order.
Async: scim_bulk_async(…) → Future[ScimBulkResponse]
search_groups(*,schemas: SupportsGetItem[int, str] | None = None,attributes: SupportsGetItem[int, str] | None = None,excluded_attributes: SupportsGetItem[int, str] | None = None,filter: str | None = None,start_index: SupportsIndex | None = None,count: SupportsIndex | None = None,) → ListScimGroupsResponse¶
List the groups with a search request in the body. Only the metastore admin can.
Parameters
- schemas (SupportsGetItem[int, str] | None, optional) – SCIM schema URIs of the request:
urn:ietf:params:scim:api:messages:2.0:SearchRequest. - attributes (SupportsGetItem[int, str] | None, optional) – The only attributes to return, such as
userName. - excluded_attributes (SupportsGetItem[int, str] | None, optional) – The attributes to leave out.
- filter (str | None, optional) – SCIM filter (RFC 7644, section 3.4.2.2).
- start_index (SupportsIndex | None, optional) – Index of the first resource to return, from 1.
- count (SupportsIndex | None, optional) – The maximum number of resources to return, at most 1000. The default is 50.
Returns
- ListScimGroupsResponse – A page of SCIM groups.
Async: search_groups_async(…) → Future[ListScimGroupsResponse]
search_objects(query: str,*,securable_type: str | None = None,max_results: SupportsIndex | None = None,page_token: str | None = None,) → SearchObjectsResponse¶
Find the objects whose name or comment holds all the words of a query.
Parameters
- query (str) – The words to find in the names and comments. An object matches when it holds all of them.
- securable_type (str | None, optional) – Return only the objects of this type:
catalog,schema,table,volume,functionorregistered_model. - max_results (SupportsIndex | None, optional) – The maximum number of results to return.
- page_token (str | None, optional) – Opaque token of the page to return: the
next_page_tokenof the page before.
Returns
- SearchObjectsResponse – The requested resource
Async: search_objects_async(…) → Future[SearchObjectsResponse]
search_resources(*,schemas: SupportsGetItem[int, str] | None = None,attributes: SupportsGetItem[int, str] | None = None,excluded_attributes: SupportsGetItem[int, str] | None = None,filter: str | None = None,start_index: SupportsIndex | None = None,count: SupportsIndex | None = None,) → ListScimResourcesResponse¶
List the users and the groups with a search request in the body. Only the metastore admin can.
Parameters
- schemas (SupportsGetItem[int, str] | None, optional) – SCIM schema URIs of the request:
urn:ietf:params:scim:api:messages:2.0:SearchRequest. - attributes (SupportsGetItem[int, str] | None, optional) – The only attributes to return, such as
userName. - excluded_attributes (SupportsGetItem[int, str] | None, optional) – The attributes to leave out.
- filter (str | None, optional) – SCIM filter (RFC 7644, section 3.4.2.2).
- start_index (SupportsIndex | None, optional) – Index of the first resource to return, from 1.
- count (SupportsIndex | None, optional) – The maximum number of resources to return, at most 1000. The default is 50.
Returns
- ListScimResourcesResponse – A page of SCIM users and groups.
Async: search_resources_async(…) → Future[ListScimResourcesResponse]
search_users(*,schemas: SupportsGetItem[int, str] | None = None,attributes: SupportsGetItem[int, str] | None = None,excluded_attributes: SupportsGetItem[int, str] | None = None,filter: str | None = None,start_index: SupportsIndex | None = None,count: SupportsIndex | None = None,) → ListScimUsersResponse¶
List the users with a search request in the body. Only the metastore admin can.
Parameters
- schemas (SupportsGetItem[int, str] | None, optional) – SCIM schema URIs of the request:
urn:ietf:params:scim:api:messages:2.0:SearchRequest. - attributes (SupportsGetItem[int, str] | None, optional) – The only attributes to return, such as
userName. - excluded_attributes (SupportsGetItem[int, str] | None, optional) – The attributes to leave out.
- filter (str | None, optional) – SCIM filter (RFC 7644, section 3.4.2.2).
- start_index (SupportsIndex | None, optional) – Index of the first resource to return, from 1.
- count (SupportsIndex | None, optional) – The maximum number of resources to return, at most 1000. The default is 50.
Returns
- ListScimUsersResponse – A page of SCIM users.
Async: search_users_async(…) → Future[ListScimUsersResponse]
share(share_name: str) → ShareClient¶
The requests on one Share. It sends no request itself.
table(table_name: str) → TableClient¶
The requests on one TableInfo. It sends no request itself.
token(token_name: str) → TokenClient¶
The requests on one PatInfo. It sends no request itself.
update_delta_table(catalog: str,schema: str,table: str,requirements: SupportsGetItem[int, DeltaTableRequirement],updates: SupportsGetItem[int, DeltaTableUpdate],) → DeltaLoadTableResponse¶
Update a table or commit to it, then load it. A replay of an accepted add-commit is a no-op. A
version or requirement conflict is status 409; too many commits that are not backfilled is status
429.
Parameters
- requirements (SupportsGetItem[int, DeltaTableRequirement]) – Preconditions of the update. An
assert-table-uuidrequirement is always required; at most one of each type. - updates (SupportsGetItem[int, DeltaTableUpdate]) – The updates to apply. At least one; at most one of each action.
Returns
- DeltaLoadTableResponse – A Delta table: its metadata and, for a MANAGED table, its commits that are not backfilled yet.
Async: update_delta_table_async(…) → Future[DeltaLoadTableResponse]
update_iceberg_namespace_properties(catalog: str,namespace: str,*,removals: SupportsGetItem[int, str] | None = None,updates: dict[str, str] | None = None,) → IcebergUpdateNamespacePropertiesResponse¶
Set and remove properties of a namespace.
Parameters
- removals (SupportsGetItem[int, str] | None, optional) – Keys of the properties to remove. A key cannot be both removed and set.
- updates (dict[str, str] | None, optional) – Properties to set.
Returns
- IcebergUpdateNamespacePropertiesResponse – The changes of a namespace properties update.
Async: update_iceberg_namespace_properties_async(…) → Future[IcebergUpdateNamespacePropertiesResponse]
update_model_version(full_name: str,version: SupportsIndex,comment: str,) → ModelVersionInfo¶
Change a model version.
Parameters
- comment (str) – User-provided free-form text description. The comment is the only field that can change; an empty one clears it.
Returns
- ModelVersionInfo – A version of a registered model. The server gives each new version the next number.
Async: update_model_version_async(…) → Future[ModelVersionInfo]
update_permissions(securable_type: str,full_name: str,changes: SupportsGetItem[int, PermissionsChange],) → PermissionsList¶
Grant and revoke privileges on a securable. The response lists the privileges of the principals of the request.
Parameters
- changes (SupportsGetItem[int, PermissionsChange]) – The changes to make, one per principal.
Returns
- PermissionsList – The privileges on a securable, per principal.
Async: update_permissions_async(…) → Future[PermissionsList]
upload_file(file_path: str,contents: bytes | bytearray,*,overwrite: bool | None = None,) → None¶
Write a file, and create its directories. Only in volumes; needs ownership of the volume.
Parameters
- contents (bytes | bytearray) – The bytes of the file.
- overwrite (bool | None, optional) – Whether to replace a file that is already there. Without it, an existing file is an error.
Async: upload_file_async(…) → Future[None]
volume(volume_name: str) → VolumeClient¶
The requests on one VolumeInfo. It sends no request itself.
class unitycatalog.ConflictError(message: str,code: str | None = None,status: SupportsIndex | None = None,details: list | None = None,)¶
Bases: UnityCatalogError
The server answered 409 Conflict: the resource exists or changed.
class unitycatalog.NotFoundError(message: str,code: str | None = None,status: SupportsIndex | None = None,details: list | None = None,)¶
Bases: UnityCatalogError
The server answered 404 Not Found: the resource does not exist.
class unitycatalog.PermissionDeniedError(message: str,code: str | None = None,status: SupportsIndex | None = None,details: list | None = None,)¶
Bases: UnityCatalogError
The server answered 403 Forbidden: the caller may not do this.
class unitycatalog.RateLimitError(message: str,code: str | None = None,status: SupportsIndex | None = None,details: list | None = None,)¶
Bases: UnityCatalogError
The server answered 429 Too Many Requests.
class unitycatalog.ServerError(message: str,code: str | None = None,status: SupportsIndex | None = None,details: list | None = None,)¶
Bases: UnityCatalogError
The server answered with a 5xx status: it failed to do the request.
class unitycatalog.UnauthenticatedError(message: str,code: str | None = None,status: SupportsIndex | None = None,details: list | None = None,)¶
Bases: UnityCatalogError
The server answered 401 Unauthorized: the request has no valid credentials.
class unitycatalog.UnityCatalogError(message: str,code: str | None = None,status: SupportsIndex | None = None,details: list | None = None,)¶
An error answer of the server, or a request that got no answer.
Attributes
- code (str | None) – The error code of the answer, such as
NOT_FOUND, if any. - details (list) – The details of the answer.
- message (str) – The error message.
- status (int | None) – The HTTP status of the answer.
Nonewhen the request got no answer.
version: Final[str] { #unitycatalog.version .uc-api data-toc-label="version" }¶
The version of the bindings crate.