snowflake.core.dynamic_table.DynamicTableResource¶
- class snowflake.core.dynamic_table.DynamicTableResource(name: str, collection_class: DynamicTableCollectionBase)¶
Bases:
DynamicTableResourceBase
Represents a reference to a Snowflake dynamic table.
With this dynamic table reference, you can create, drop, undrop, suspend, resume, swap_with other table, suspend recluster, resume recluster and fetch information about dynamic tables, as well as perform certain actions on them.
Attributes
- database¶
The DatabaseResource this reference belongs to.
- fully_qualified_name¶
Return the fully qualified name of the object this reference points to.
- root¶
The Root object this reference belongs to.
Methods
- clone(dynamic_table_clone: DynamicTableClone, create_mode: CreateMode | str | None = None, copy_grants: bool | None = None, target_database: str | None = None, target_schema: str | None = None) None ¶
Clone dynamic table.
- Parameters:
dynamic_table_clone (DynamicTableClone) – (required)
create_mode (Union[CreateMode, str]) – Parameter allowing support for different modes of resource creation. Possible values include: - errorIfExists: Throws an error if you try to create a resource that already exists. - orReplace: Automatically replaces the existing resource with the current one. - ifNotExists: Creates a new resource when an alter is requested for a non-existent resource.
copy_grants (bool) – Parameter to enable copy grants when creating the object.
target_database (str) – Database of the newly created dynamic table. Defaults to the source table’s database.
target_schema (str) – Schema of the newly created dynamic table. Defaults to the source table’s schema.
- clone_async(dynamic_table_clone: DynamicTableClone, create_mode: CreateMode | str | None = None, copy_grants: bool | None = None, target_database: str | None = None, target_schema: str | None = None) PollingOperation[None] ¶
An asynchronous version of
clone()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- drop(if_exists: bool | None = None) None ¶
Delete a dynamic table.
- Parameters:
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- drop_async(if_exists: bool | None = None) PollingOperation[None] ¶
An asynchronous version of
drop()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- fetch() DynamicTable ¶
Fetch a dynamic table.
- fetch_async() PollingOperation[DynamicTable] ¶
An asynchronous version of
fetch()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- refresh(if_exists: bool | None = None) None ¶
Refresh the dynamic table.
- Parameters:
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- refresh_async(if_exists: bool | None = None) PollingOperation[None] ¶
An asynchronous version of
refresh()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- resume(if_exists: bool | None = None) None ¶
Resume refreshes on the dynamic table.
- Parameters:
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- resume_async(if_exists: bool | None = None) PollingOperation[None] ¶
An asynchronous version of
resume()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- resume_recluster(if_exists: bool | None = None) None ¶
Resume recluster of a dynamic table.
- Parameters:
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- resume_recluster_async(if_exists: bool | None = None) PollingOperation[None] ¶
An asynchronous version of
resume_recluster()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- suspend(if_exists: bool | None = None) None ¶
Suspend refreshes on the dynamic table.
- Parameters:
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- suspend_async(if_exists: bool | None = None) PollingOperation[None] ¶
An asynchronous version of
suspend()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- suspend_recluster(if_exists: bool | None = None) None ¶
Suspend recluster of a dynamic table.
- Parameters:
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- suspend_recluster_async(if_exists: bool | None = None) PollingOperation[None] ¶
An asynchronous version of
suspend_recluster()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- swap_with(to_swap_table_name: str, if_exists: bool | None = None) None ¶
Swap the name with another dynamic table.
- Parameters:
to_swap_table_name (str) – The name of the table to swap with.
if_exists (bool, optional) – Check the existence of this dynamic table before swapping its name. Default is
None
, which is equivalent toFalse
.
Examples
Swaping name with another dynamic table using its reference: >>> dynamic_table_reference.swap_with(“my_other_dynamic_table”)
- swap_with_async(to_swap_table_name: str, if_exists: bool | None = None) PollingOperation[None] ¶
An asynchronous version of
swap_with()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.
- undelete() None ¶
The
undelete()
method is deprecated; useundrop()
instead.
- undrop() None ¶
Undrop a dynamic table.
- undrop_async() PollingOperation[None] ¶
An asynchronous version of
undrop()
.Refer to
PollingOperation
for more information on asynchronous execution and the return type.