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:
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
pip install finai-snowflake-transform
# with the Snowflake runtime extra
pip install "finai-snowflake-transform[snowflake]"
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.
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
Metadata
Release files for finai-snowflake-transform 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| finai_snowflake_transform-0.1.0.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| finai_snowflake_transform-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / finai_snowflake_transform-0.1.0.tar.gz
| Download URL | finai_snowflake_transform-0.1.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca0ad514d8e44bf54d5d316b3b8136ab5139ccd6a4f01221da0e5361aea96e0a
|
|
BLAKE2b-256 checksum How to use checksums |
c1896b6e618323aa9e380831b7ae3ddda502f464be6e7a2228b39949b2433bb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.9
|
Release files / finai_snowflake_transform-0.1.0-py3-none-any.whl
| Download URL | finai_snowflake_transform-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4fd2f583369364b64c76c853ef00b2d73c81eb803adb02f6dedd0ffa59667e7
|
|
BLAKE2b-256 checksum How to use checksums |
80dd4d903d8da0c1062b300857ca7331e998e34da8dfc20bca0e434f199def53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.9
|