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 toFalse
.
Examples
Deleting a pipe using its reference:
>>> pipe_reference.drop()
Using a pipe reference to delete a pipe if it exists:
>>> pipe_reference.drop(if_exists=True)
- 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)
- 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 toFalse
.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")