flytekitplugins.snowflake.agent
flytekitplugins.snowflake.agent
Property
Type
Description
SNOWFLAKE_PRIVATE_KEY
str
TASK_TYPE
str
def construct_query_link (
resource_meta: flytekitplugins. snowflake. agent. SnowflakeJobMetadata,
) -> str
Parameter
Type
resource_meta
flytekitplugins.snowflake.agent.SnowflakeJobMetadata
def get_connection (
metadata: flytekitplugins. snowflake. agent. SnowflakeJobMetadata,
) -> < module 'snowflake.connector' from '/Users/nelson/src/flyteorg/flytekit/.venv/lib/python3.12/site-packages/snowflake/connector/__init__.py' >
Parameter
Type
metadata
flytekitplugins.snowflake.agent.SnowflakeJobMetadata
This is the base class for all async agents. It defines the interface that all agents must implement.
The agent service is responsible for invoking agents. The propeller will communicate with the agent service
to create tasks, get the status of tasks, and delete tasks.
All the agents should be registered in the AgentRegistry. Agent Service
will look up the agent based on the task type. Every task type can only have one agent.
Method
Description
create()
Return a resource meta that can be used to get the status of the task.
delete()
Delete the task.
get()
Return the status of the task, and return the outputs in some cases.
def create (
task_template: flytekit. models. task. TaskTemplate,
inputs: typing. Optional[flytekit. models. literals. LiteralMap],
kwargs,
) -> flytekitplugins. snowflake. agent. SnowflakeJobMetadata
Return a resource meta that can be used to get the status of the task.
Parameter
Type
task_template
flytekit.models.task.TaskTemplate
inputs
typing.Optional[flytekit.models.literals.LiteralMap]
kwargs
**kwargs
def delete (
resource_meta: flytekitplugins. snowflake. agent. SnowflakeJobMetadata,
kwargs,
)
Delete the task. This call should be idempotent. It should raise an error if fails to delete the task.
Parameter
Type
resource_meta
flytekitplugins.snowflake.agent.SnowflakeJobMetadata
kwargs
**kwargs
def get (
resource_meta: flytekitplugins. snowflake. agent. SnowflakeJobMetadata,
kwargs,
) -> flytekit. extend. backend. base_agent. Resource
Return the status of the task, and return the outputs in some cases. For example, bigquery job
can’t write the structured dataset to the output location, so it returns the output literals to the propeller,
and the propeller will write the structured dataset to the blob store.
Parameter
Type
resource_meta
flytekitplugins.snowflake.agent.SnowflakeJobMetadata
kwargs
**kwargs
Property
Type
Description
metadata_type
task_category
task category that the agent supports
class SnowflakeJobMetadata (
user: str,
account: str,
database: str,
schema: str,
warehouse: str,
query_id: str,
has_output: bool,
)
Parameter
Type
user
str
account
str
database
str
schema
str
warehouse
str
query_id
str
has_output
bool
Method
Description
decode()
Decode the resource meta from bytes.
encode()
Encode the resource meta to bytes.
def decode (
data: bytes,
) -> ResourceMeta
Decode the resource meta from bytes.
Parameter
Type
data
bytes
Encode the resource meta to bytes.