Skip to content

Lakehouse

Warning

The functions are not fully tested yet. Use with caution. Please report any issues to the GitHub repository.

lakehouse_create

lakehouse_create(workspace_id: str, display_name: str, description: str = None, enable_schemas: bool = None, await_lro: bool = None, timeout: int = 60 * 5, preview: bool = True) -> requests.Response

Create a lakehouse.

Parameters:

Name Type Description Default
workspace_id str

The id of the workspace to create the lakehouse in.

required
display_name str

The display name of the lakehouse.

required
description str | None

The description of the lakehouse.

None
enable_schemas bool | None

Whether the lakehouse is schema enabled.

None
await_lro bool | None

Whether to await the long running operation.

None
timeout int

Timeout for the long running operation (seconds). Defaults to 5 minutes.

60 * 5
preview bool

Whether to preview the request. You will be asked to confirm the request before it is executed. Defaults to True.

True

Returns:

Type Description
Response

The response from the request.

lakehouse_get

lakehouse_get(workspace_id: str, lakehouse_id: str, preview: bool = True) -> requests.Response

Get a lakehouse.

Parameters:

Name Type Description Default
workspace_id str

The id of the workspace to get the lakehouse from.

required
lakehouse_id str

The id of the lakehouse to get.

required
preview bool

Whether to preview the request. You will be asked to confirm the request before it is executed. Defaults to True.

True

Returns:

Type Description
Response

The response from the request.

lakehouse_list

lakehouse_list(workspace_id: str, continuation_token: str = None, preview: bool = True) -> requests.Response

List lakehouses for a workspace.

Parameters:

Name Type Description Default
workspace_id str

The id of the workspace to list lakehouses for.

required
continuation_token str | None

A token for retrieving the next page of results.

None
preview bool

Whether to preview the request. You will be asked to confirm the request before it is executed. Defaults to True.

True

Returns:

Type Description
Response

The response from the request.

lakehouse_update

lakehouse_update(workspace_id: str, lakehouse_id: str, display_name: str = None, description: str = None, preview: bool = True) -> requests.Response

Update a lakehouse.

Parameters:

Name Type Description Default
workspace_id str

The id of the workspace to update.

required
lakehouse_id str

The id of the lakehouse to update.

required
display_name str | None

The display name of the lakehouse.

None
description str | None

The description of the lakehouse.

None
preview bool

Whether to preview the request. You will be asked to confirm the request before it is executed. Defaults to True.

True

Returns:

Type Description
Response

The response from the request.

lakehouse_delete

lakehouse_delete(workspace_id: str, lakehouse_id: str, preview: bool = True) -> requests.Response

Delete a lakehouse.

Parameters:

Name Type Description Default
workspace_id str

The id of the workspace to delete.

required
lakehouse_id str

The id of the lakehouse to delete.

required
preview bool

Whether to preview the request. You will be asked to confirm the request before it is executed. Defaults to True.

True

Returns:

Type Description
Response

The response from the request.

lakehouse_run_background_job

lakehouse_run_background_job(workspace_id: str, lakehouse_id: str, job_type: str, table_name: str, schema_name: str = None, v_order: bool = None, z_order_columns: List[str] = None, retention_period: str = None, await_lro: bool = None, timeout: int = 60 * 5, preview: bool = True) -> requests.Response

Run on-demand table maintenance job instance.

Parameters:

Name Type Description Default
workspace_id str

The id of the workspace to create a job for.

required
lakehouse_id str

The id of the lakehouse to create a job for.

required
job_type str

The type of the job to create. Must be "TableMaintenance".

required
table_name str

The name of the table to run the job on.

required
schema_name str | None

The name of the schema to run the job on. Only applicable for schema enabled lakehouses.

None
v_order bool | None

If table should be v-ordered.

None
z_order_columns List[str] | None

List of columns to z-order by.

None
retention_period str | None

Retention periode in format d:hh:mm:ss. Overrides the default retention period.

None
await_lro bool | None

Whether to await the long running operation.

None
timeout int

Timeout for the long running operation (seconds). Defaults to 5 minutes.

60 * 5
preview bool

Whether to preview the request. You will be asked to confirm the request before it is executed. Defaults to True.

True

Returns:

Type Description
Response

The response from the request.

lakehouse_list_tables

lakehouse_list_tables(workspace_id: str, lakehouse_id: str, continuation_token: str = None, max_results: int = None, preview: bool = True) -> requests.Response

List tables in a lakehouse.

Parameters:

Name Type Description Default
workspace_id str

The id of the workspace to list tables for.

required
lakehouse_id str

The id of the lakehouse to list tables for.

required
continuation_token str | None

A token for retrieving the next page of results.

None
max_results int | None

The maximum number of results to return.

None
preview bool

Whether to preview the request. You will be asked to confirm the request before it is executed. Defaults to True.

True

Returns:

Type Description
Response

The response from the request.

lakehouse_load_table

lakehouse_load_table(workspace_id: str, lakehouse_id: str, table_name: str, relative_path: str, path_type: str, format: str = None, header: bool = None, delimiter: str = None, mode: str = None, file_extension: str = None, recursive: bool = None, await_lro: bool = None, timeout: int = 60 * 5, preview: bool = True) -> requests.Response

Load a table.

Parameters:

Name Type Description Default
workspace_id str

The id of the workspace to load the table for.

required
lakehouse_id str

The id of the lakehouse to load the table for.

required
table_name str

The name of the table to load.

required
relative_path str

The relative path to the table to load.

required
path_type str

The type of the path to load. Either "File" or "Folder".

required
format str | None

The format of the files to load. Must be "Parquet" or "Csv".

None
header bool | None

Whether the file has a header row. Only applicable for csv files.

None
delimiter str | None

The delimiter of the csv files. Only applicable for csv files.

None
mode str | None

The mode to load the table in. Either "Overwrite" or "Append".

None
file_extension str | None

The file extension of the files to load.

None
recursive bool | None

Whether to search data files recursively or not, when loading from a folder.

None
await_lro bool | None

Whether to await the long running operation.

None
timeout int

Timeout for the long running operation (seconds). Defaults to 5 minutes.

60 * 5
preview bool

Whether to preview the request. You will be asked to confirm the request before it is executed. Defaults to True.

True

Returns:

Type Description
Response

The response from the request.