mysterious-byte-28133
04/22/2026, 4:02 PMres = {
"results": TypeEngine.to_literal(
ctx,
StructuredDataset(uri=uri),
StructuredDataset,
LiteralType(structured_dataset_type=StructuredDatasetType(format="")),
)
}
Whereas in the BigQuery agent, it is returned more directly:
res = {"results": StructuredDataset(uri=output_location)}
With the Snowflake approach (using <http://TypeEngine.to|TypeEngine.to>_literal), I’m not getting the expected output. Instead, the result from a SELECT query is coming back as type PythonPickle.
However, when I created a custom image and modified the implementation to follow the BigQuery approach, it worked as expected.
Could you help me understand what I might be missing here? Is there additional configuration or a step required when using the Snowflake agent approach?
References:
https://github.com/flyteorg/flytekit/blob/e1518f6bba37eead55aeb0ec98e4c49904023c57/plugins/flytekit-bigquery/flytekitplugins/bigquery/agent.py#L88-L89 https://github.com/flyteorg/flytekit/blob/e1518f6bba37eead55aeb0ec98e4c49904023c57/plugins/flytekit-snowflake/flytekitplugins/snowflake/agent.py#L116
Example I tried:
https://docs-legacy.flyte.org/en/v1.14.1/flytesnacks/examples/snowflake_agent/snowflake_agent_example_usage.html (edited)tall-lock-23197
to_literal should work as well. there might be an issue with the type being returned (i.e. no match for some reason).
you can continue using the bigquery approach for the snowflake integration. you’re also welcome to upstream it if you’d like, but with production v2 coming in, we’d eventually want you to use that 🙂