snowflake.core.warehouse.WarehouseCollection¶
- class snowflake.core.warehouse.WarehouseCollection(root: Root)¶
Bases:
AccountObjectCollectionParent[WarehouseResource]Represents the collection operations of the Snowflake Warehouse resource.
With this collection, you can create or update or fetch all warehouses that you have access to.
- Parameters:
root – A
Rootinstance.
Example
Create a WarehouseCollection instance:
Attributes
- root¶
Methods
- create(warehouse: WarehouseModel, *, mode: CreateMode = CreateMode.error_if_exists) WarehouseResource¶
Create a warehouse in Snowflake.
- Parameters:
warehouse – an instance of
Warehouse.mode –
One of the following enum values.
- CreateMode.error_if_exists: Throw an
snowflake.core.exceptions.ConflictErrorif the warehouse already exists in Snowflake. Equivalent to SQL
create warehouse <name> ....- CreateMode.or_replace: Replace if the warehouse already exists in Snowflake. Equivalent to SQL
create or replace warehouse <name> ....- CreateMode.if_not_exists: Do nothing if the warehouse already exists in Snowflake. Equivalent to SQL
create warehouse <name> if not exists...
Default value is CreateMode.error_if_exists.
- CreateMode.error_if_exists: Throw an
Example
Create a warehouse on Snowflake server and get the reference to it:
- items() ItemsView[str, T]¶
- iter(*, like: str | None = None) Iterator[WarehouseModel]¶
Iterate over the list of warehouses in Snowflake, filtering on any optional like pattern.
- Parameters:
like – A case-insensitive
stringfunctioning as a filter, with support for SQL wildcard characters (% and _).
Example
Create a warehouse on Snowflake server and get the reference to it:
- keys() KeysView[str]¶
- values() ValuesView[T]¶