Metadata-Version: 2.5
Name: render-lab-tasks-snowflake
Version: 0.1.0
Summary: snowflake tasks for Render Workflows
Project-URL: Repository, https://github.com/render-lab/render-tasks-python
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: render-lab-tasks-core<0.2,>=0.1.1
Requires-Dist: render==1.0.1
Description-Content-Type: text/markdown

# render-lab-tasks-snowflake

Nine SQL API tasks: query, execute, insertRows, executeMany, submitStatement,
getStatementStatus, awaitStatement, getStatementResults, and cancelStatement.
Import `render_lab_tasks_snowflake.tasks` for explicit registration. Raw operations
also export injectable async `*_impl(ctx, input, *, deps=...)` functions.

| Environment variable | Contract |
| --- | --- |
| SNOWFLAKE_ACCOUNT_URL | Required account HTTPS URL |
| SNOWFLAKE_TOKEN | Required ready-to-use token |
| SNOWFLAKE_TOKEN_TYPE | OAUTH (default), KEYPAIR_JWT, or PROGRAMMATIC_ACCESS_TOKEN |
| SNOWFLAKE_DATABASE / SCHEMA / WAREHOUSE / ROLE | Optional statement defaults; input overrides |

All credentials are lazy. The client neither mints JWTs nor refreshes OAuth.
Submissions require a caller-generated UUID requestId, sent with retry=true.
Keep this UUID stable across retries and unique for each intended submission.
Parameters use positional bindings; returned cells remain strings/null, including
wide decimal values. Quote helpers escape table/column identifiers for inserts.

Each attempt makes one request. Await polls by throwing; the durable policy is
one hour at 10-second intervals. Other operations retry three times with 1-second
exponential backoff. Terminal await errors still use the inherited retry policy.

Query returns the first partition, capped at maxRows (10,000 by default).
getStatementResults enforces maxBytes (3,500,000 default) after reading the response.
The source query/submit paths do not enforce a byte cap; callers should bound SQL
results, and this inherited gap is tracked for both repos. query accepts caller SQL
and does not parse or enforce read-only statements. Cancellation treats 404/422 as
converged, matching the source. Live SQL API checks remain unverified.

## Installation

```sh
pip install render-lab-tasks-snowflake==0.1.0
```
