2.0.0b53

SnowflakeConnector

Package: flyteplugins.connectors.snowflake.connector

This is the base class for all async connectors, and it defines the interface that all connectors must implement. The connector service is responsible for invoking connectors. The executor will communicate with the connector service to create tasks, get the status of tasks, and delete tasks.

All the connectors should be registered in the ConnectorRegistry. Connector Service will look up the connector based on the task type and version.

Methods

Method Description
create() Submit a query to Snowflake asynchronously.
delete() Cancel a running Snowflake query.
get() Poll the status of a Snowflake query.
get_logs() Return the metrics for the task.
get_metrics() Return the metrics for the task.

create()

def create(
    task_template: flyteidl2.core.tasks_pb2.TaskTemplate,
    inputs: typing.Optional[typing.Dict[str, typing.Any]],
    snowflake_private_key: typing.Optional[str],
    snowflake_private_key_passphrase: typing.Optional[str],
    kwargs,
) -> flyteplugins.connectors.snowflake.connector.SnowflakeJobMetadata

Submit a query to Snowflake asynchronously.

Parameter Type Description
task_template flyteidl2.core.tasks_pb2.TaskTemplate
inputs typing.Optional[typing.Dict[str, typing.Any]]
snowflake_private_key typing.Optional[str]
snowflake_private_key_passphrase typing.Optional[str]
kwargs **kwargs

delete()

def delete(
    resource_meta: flyteplugins.connectors.snowflake.connector.SnowflakeJobMetadata,
    snowflake_private_key: typing.Optional[str],
    snowflake_private_key_passphrase: typing.Optional[str],
    kwargs,
)

Cancel a running Snowflake query.

Parameter Type Description
resource_meta flyteplugins.connectors.snowflake.connector.SnowflakeJobMetadata
snowflake_private_key typing.Optional[str]
snowflake_private_key_passphrase typing.Optional[str]
kwargs **kwargs

get()

def get(
    resource_meta: flyteplugins.connectors.snowflake.connector.SnowflakeJobMetadata,
    snowflake_private_key: typing.Optional[str],
    snowflake_private_key_passphrase: typing.Optional[str],
    kwargs,
) -> flyte.connectors._connector.Resource

Poll the status of a Snowflake query.

Parameter Type Description
resource_meta flyteplugins.connectors.snowflake.connector.SnowflakeJobMetadata
snowflake_private_key typing.Optional[str]
snowflake_private_key_passphrase typing.Optional[str]
kwargs **kwargs

get_logs()

def get_logs(
    resource_meta: flyte.connectors._connector.ResourceMeta,
    kwargs,
) -> flyteidl2.connector.connector_pb2.GetTaskLogsResponse

Return the metrics for the task.

Parameter Type Description
resource_meta flyte.connectors._connector.ResourceMeta
kwargs **kwargs

get_metrics()

def get_metrics(
    resource_meta: flyte.connectors._connector.ResourceMeta,
    kwargs,
) -> flyteidl2.connector.connector_pb2.GetTaskMetricsResponse

Return the metrics for the task.

Parameter Type Description
resource_meta flyte.connectors._connector.ResourceMeta
kwargs **kwargs