Skip to main content

whylogs Airflow Operator

This is a package for the whylogs provider, the open source standard for data and ML logging. With whylogs, users are able to generate summaries of their datasets (called whylogs profiles) which they can use to:

  • Track changes in their dataset
  • Create data constraints to know whether their data looks the way it should
  • Quickly visualize key summary statistics about their datasets

This Airflow operator focuses on simplifying whylogs' usage along with Airflow. Users are encouraged to benefit from their existing Data Profiles, which are created with whylogs and can bring a lot of value and visibility to track their data changes over time.

Installation

You can install this package on top of an existing Airflow 2.0+ installation (Requirements) by simply running:

$ pip install airflow-provider-whylogs

To install this provider from source, run these instead:

$ git clone git@github.com:whylabs/airflow-provider-whylogs.git
$ cd airflow-provider-whylogs
$ python3 -m venv .env && source .env/bin/activate
$ pip3 install -e .

Usage example

In order to benefir from the existing operators, users will have to profile their data first, with their processing environment of choice. To create and store a profile locally, run the following command on a pandas DataFrame:

import whylogs as why

df = pd.read_csv("some_file.csv")
results = why.log(df)
results.writer("local").write()

And after that, you can use our operators to either:

  • Create a Summary Drift Report, to visually help you identify if there was drift in your data
from whylogs_provider.operators.whylogs import WhylogsSummaryDriftOperator

summary_drift = WhylogsSummaryDriftOperator(
        task_id="drift_report",
        target_profile_path="data/profile.bin",
        reference_profile_path="data/profile.bin",
        reader="local",
        write_report_path="data/Profile.html",
    )
  • Run a Constraints check, to check if your profiled data met some criteria
from whylogs_provider.operators.whylogs import WhylogsConstraintsOperator
from whylogs.core.constraints.factories import greater_than_number

constraints = WhylogsConstraintsOperator(
        task_id="constraints_check",
        profile_path="data/profile.bin",
        reader="local",
        constraint=greater_than_number(column_name="my_column", number=0.0),
    )

NOTE: It is important to note that even though it is possible to create a Dataset Profile with the Python Operator, Airflow tries to separate the concern of orchestration from processing, so that is one of the reasons why we didn't want to have a strong opinion on how to read data and profile it, enabling users to best adjust this step to their existing scenario.

A full DAG example can be found on the whylogs_provider package directory.

Requirements

The current requirements to use this Airflow Provider are described on the table below.

PIP package Version required
apache-airflow >=2.0
whylogs[viz, s3] >=1.0.10

Contributing

Users are always welcome to ask questions and contribute to this repository, by submitting issues and communicating with us through our community Slack. Feel free to reach out and make whylogs even more awesome to use with Airflow.

Happy coding! 😄

Metadata

Release files for airflow-provider-whylogs 0.0.2

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

Source distribution (sdist)

Source distribution for airflow-provider-whylogs 0.0.2
File Size Uploaded Provenance Actions
airflow-provider-whylogs-0.0.2.tar.gz 9.1 kB Without provenance Details for airflow-provider-whylogs-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for airflow-provider-whylogs 0.0.2
File Interpreter ABI Platform Actions
airflow_provider_whylogs-0.0.2-py3-none-any.whl Python 3 none any Details for airflow_provider_whylogs-0.0.2-py3-none-any.whl

Total release size: 19.5 kB

Release files / airflow-provider-whylogs-0.0.2.tar.gz

Download URL airflow-provider-whylogs-0.0.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
02914c3f5c2f7299a1b32aa55171953db1e61678025ef5443715305ad4b4c332
BLAKE2b-256 checksum
How to use checksums
fe20e8f40fe8b0fa1027afe5e608c94f68fea19c7a367884db4ee699ceef44dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / airflow_provider_whylogs-0.0.2-py3-none-any.whl

Download URL airflow_provider_whylogs-0.0.2-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4658e3b3f5fbaf7036df5a6461fdbcfceb2d5ca3faeda9b1073526634c10b3e
BLAKE2b-256 checksum
How to use checksums
c15b4ec7683748239d212f0e972f157d05471c516143eee8332a8c9268f38162
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for airflow-provider-whylogs 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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