snowflake.core.pipe.PipeResource

class snowflake.core.pipe.PipeResource(name: str, collection: PipeCollection)

Bases: SchemaObjectReferenceMixin[PipeCollection]

Represents a reference to a Snowflake pipe.

With this pipe reference, you can fetch information about pipes, as well as perform certain actions on them.

Attributes

database
fully_qualified_name
root

Methods

drop(if_exist: bool | None = None) None

Drop this pipe.

Parameters:

if_exist (bool, optional) – If True, does not throw an exception if the pipe does not exist. The default is None, which behaves equivalently to it being False.

Examples

Deleting a pipe using its reference:

>>> pipe_reference.drop()
Copy

Using a pipe reference to delete a pipe if it exists:

>>> pipe_reference.drop(if_exist=True)
Copy
fetch() Pipe

Fetch the details of a pipe resource.

Examples

Fetching a pipe using its reference:

>>> pipe = pipe_reference.fetch()
# Accessing information of the pipe with pipe instance.
>>> print(pipe.name, pipe.comment)
Copy
refresh(if_exist: bool | None = None, prefix: str | None = None, modified_after: datetime | None = None) None

Refresh this pipe.

Parameters:
  • if_exist (bool, optional) – If True, does not throw an exception if the pipe does not exist. The default is None, which behaves equivalently to it being False.

  • prefix (str, optional) – Path (or prefix) appended to the stage reference in the pipe definition.

  • modified_after (datetime, optional) – Timestamp (in ISO-8601 format) of the oldest data files to copy into the Snowpipe ingest queue based on the LAST_MODIFIED date (i.e. date when a file was staged).

Examples

Using a pipe reference to refresh it:

>>> pipe_reference.refresh(prefix="your_prefix")
Copy