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_exists: bool | None = None) None

Drop this pipe.

Parameters:

if_exists (bool, optional) – Check the existence of this pipe before dropping it. Default is None, which is equivalent to 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_exists=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_exists: bool | None = None, prefix: str | None = None, modified_after: datetime | None = None) None

Refresh this pipe.

Parameters:
  • if_exists (bool, optional) – Check the existence of this pipe before refreshing it. Default is None, which is equivalent to 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