Skip to main content

Dask + Snowflake intergration

Project description

Dask-Snowflake

Tests Linting

Installation

dask-snowflake can be installed with pip:

pip install dask-snowflake

or with conda:

conda install -c conda-forge dask-snowflake

Usage

dask-snowflake provides read_snowflake and to_snowflake methods for parallel IO from Snowflake with Dask.

>>> from dask_snowflake import read_snowflake
>>> example_query = '''
...    SELECT *
...    FROM SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.CUSTOMER;
... '''
>>> ddf = read_snowflake(
...     query=example_query,
...     connection_kwargs={
...         "user": "...",
...         "password": "...",
...         "account": "...",
...     },
... )
>>> from dask_snowflake import to_snowflake
>>> to_snowflake(
...     ddf,
...     name="my_table",
...     connection_kwargs={
...         "user": "...",
...         "password": "...",
...         "account": "...",
...     },
... )

See their docstrings for further API information.

Tests

Running tests requires a Snowflake account and access to a database. The test suite will automatically look for specific SNOWFLAKE_* environment variables (listed below) that must be set.

It's recommended (though not required) to store these environment variables in a local .env file in the root of the dask-snowflake repository. This file will be automatically ignored by git, reducing the risk of accidentally commiting it.

Here's what an example .env file looks like:

SNOWFLAKE_USER="<test user name>"
SNOWFLAKE_PASSWORD="<test_user_password>"
SNOWFLAKE_ACCOUNT="<account>.<region>.aws"
SNOWFLAKE_WAREHOUSE="<test warehouse>"
SNOWFLAKE_ROLE="<test role>"
SNOWFLAKE_DATABASE="<test database>"
SNOWFLAKE_SCHEMA="<test schema>"

You may then source .env or install pytest-dotenv to automatically set these environment variables.

Note: If you run the tests and get an MemoryError mentioning "write+execute memory for ffi.callback()", you probably have stale build of cffi from conda-forge. Remove it and install the version using pip:

conda remove cffi --force
pip install cffi

License

BSD-3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dask-snowflake-0.3.4.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dask_snowflake-0.3.4-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file dask-snowflake-0.3.4.tar.gz.

File metadata

  • Download URL: dask-snowflake-0.3.4.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dask-snowflake-0.3.4.tar.gz
Algorithm Hash digest
SHA256 0b415ebfc8bc70ab388ea0f47728d1e87559ad3db219ca79ee87e9f8060d68ef
MD5 bf3dae74be61ff8ee9cd1bf4675ce3a7
BLAKE2b-256 f60b131e7bd95b07970e9c43089a837f8742c1d1ee4d423e569a437fa5093a61

See more details on using hashes here.

Provenance

The following attestation bundles were made for dask-snowflake-0.3.4.tar.gz:

Publisher: wheels.yml on dask-contrib/dask-snowflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dask_snowflake-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: dask_snowflake-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dask_snowflake-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3f4b4a2472c34962a8ad20969d5aae60910141b6dee77d1c2f8f17ee158c79a5
MD5 7f0a8179cf43894fb8b419ca7508b75c
BLAKE2b-256 52661ef9afc8fd0c3752c482d707e376f226c39f433f044d38c2df9fcd500156

See more details on using hashes here.

Provenance

The following attestation bundles were made for dask_snowflake-0.3.4-py3-none-any.whl:

Publisher: wheels.yml on dask-contrib/dask-snowflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page