Skip to main content

prefect-soda-core

Welcome!

Prefect 2.0 collection for Soda Core

Getting Started

Python setup

Requires an installation of Python 3.7+.

We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.

These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the Prefect documentation.

Installation

prefect-soda-core is based on soda-core.
As soda-core requires you to specify the right option for your database, so does prefect-soda-core.
I.e. to use prefect-soda-core with Snowflake, run the following:

pip install prefect-soda-core[snowflake]

You can find the list of supported options in setup.py.

Please note that since this integration is built on top of Soda CLI, it is not possible to run data quality checks using Spark.

Write and run a flow

from prefect import flow
from prefect.context import get_run_context
from prefect_soda_core.soda_configuration import SodaConfiguration
from prefect_soda_core.sodacl_check import SodaCLCheck
from prefect_soda_core.tasks import soda_scan_execute


@flow
def run_soda_scan():
    soda_configuration_block = SodaConfiguration(
        configuration_yaml_path="/path/to/config.yaml"
    )
    soda_check_block = SodaCLCheck(
        sodacl_yaml_path="/path/to/checks.yaml"
    )
    
    # Using the flow_run_name as the name of the file to store the scan results
    flow_run_name = get_run_context().flow_run.name
    scan_results_file_path = f"{flow_run_name}.json"
    
    return soda_scan_execute(
        data_source_name="my_datasource",
        configuration=soda_configuration_block,
        checks=soda_check_block,
        variables={"var": "value"},
        scan_results_file=scan_results_file_path,
        verbose=True,
        return_scan_result_file_content=False,
        shell_env={"SNOWFLAKE_PASSWORD": "********"}
    )

run_soda_scan()

Resources

If you encounter any bugs while using prefect-soda-core, feel free to open an issue in the prefect-soda-core repository.

If you have any questions or issues while using prefect-soda-core, you can find help in either the Prefect Discourse forum or the Prefect Slack community.

Development

If you'd like to install a version of prefect-soda-core for development, clone the repository and perform an editable install with pip:

git clone https://github.com/sodadata/prefect-soda-core.git

cd prefect-soda-core/

pip install -e ".[dev]"

# Install linting pre-commit hooks
pre-commit install

Release files for prefect-soda-core 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prefect-soda-core 0.1.8
File Size Uploaded
prefect-soda-core-0.1.8.tar.gz 28.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prefect-soda-core 0.1.8
File Interpreter ABI Platform
prefect_soda_core-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 41.0 kB

Release files / prefect-soda-core-0.1.8.tar.gz

Download URL prefect-soda-core-0.1.8.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c660e4cbaa8cf4fd79128d18fad8f1ccd6d14d7288d25a6025574cbea30b2ada
BLAKE2b-256 checksum
How to use checksums
887275a4fb5e037f40b96d9b0f2d1e5b0f86de45f4e385ea2e816f45459c05db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / prefect_soda_core-0.1.8-py3-none-any.whl

Download URL prefect_soda_core-0.1.8-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
252faece1e2c527abeff9c1ba2a297d75f8f3f7c129d6f2bcc147b487606dbcd
BLAKE2b-256 checksum
How to use checksums
85f0a9f206f4b42c57cd31b3d5a36816bd5bf2b59f22b754ff62e1430743471a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page