Metadata-Version: 2.5
Name: finai-snowflake-transform
Version: 0.1.1
Summary: YAML-driven demo transformation for Snowpark and pandas on Snowflake
Author: finai-data-analytics
License-Expression: MIT
Keywords: pandas,snowflake,snowpark,transform
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: <3.15,>=3.12
Requires-Dist: modin==0.37.1
Requires-Dist: numpy==2.5.3
Requires-Dist: pandas==2.3.3
Requires-Dist: pyyaml==6.0.3
Requires-Dist: snowflake-snowpark-python[modin]==1.55.0
Description-Content-Type: text/markdown

# finai-snowflake-transform

A small public package used to verify that a PyPI release, including YAML files
bundled inside it, can be installed and executed inside Snowflake through both
Snowpark and pandas on Snowflake.

## Transformation

Parameters are read from a YAML file bundled in the package, so nothing depends
on the working directory:

```text
TRANSFORMED_VALUE = fill_null(VALUE, null_fill) * scale + offset
```

| Config | scale | offset | null_fill |
| --- | --- | --- | --- |
| `defaults.yaml` | 2.0 | 1.0 | 0.0 |
| `alternate.yaml` | 3.0 | -1.0 | 2.0 |

## Install

```bash
pip install finai-snowflake-transform
```

The Snowflake runtime is a base dependency, exactly pinned, so this one name is the whole
spec a Snowflake procedure needs:

```sql
packages = ('finai-snowflake-transform==0.1.1')
```

| Dependency | Pin |
| --- | --- |
| `snowflake-snowpark-python[modin]` | `==1.55.0` |
| `modin` | `==0.37.1` |
| `pandas` | `==2.3.3` |
| `numpy` | `==2.5.3` |
| `PyYAML` | `==6.0.3` |

Python `>=3.12,<3.15`: 3.12 is the Snowflake procedure runtime and numpy 2.5.3's floor,
and Snowpark caps at 3.15. Pins are raised in a new release rather than widened here.

## Use

`ID` and `VALUE` are preserved and `TRANSFORMED_VALUE` is appended. Arithmetic
stays native to the engine you pass in; the caller reads and writes tables.

```python
from finai_snowflake_transform import (
    load_config,
    transform_pandas_on_snowflake,
    transform_snowpark,
)

load_config("defaults.yaml")
# {'scale': 2.0, 'offset': 1.0, 'null_fill': 0.0}

# pandas on Snowflake (also works with plain pandas)
import modin.pandas as pd
import snowflake.snowpark.modin.plugin  # noqa: F401

out = transform_pandas_on_snowflake(pd.read_snowflake("MY_INPUT"), "defaults.yaml")

# Snowpark
out = transform_snowpark(session.table("MY_INPUT"), "alternate.yaml")
```

Invalid configuration names, non-mapping YAML, missing parameters, booleans and
non-finite numbers all raise immediately with a message naming the config file.

## License

MIT
