Adding it to a stack is as simple as running e.g.:# Register the whylogs data validator

zenml data-validator register whylogs_data_validator --flavor=whylogs

# Register and set a stack with the new data validator

zenml stack register custom_stack -dv whylogs_data_validator ... --set

Adding WhyLabs logging capabilities to your whylogs Data Validator is just slightly more complicated, as you also need to create a ZenML Secret to store the sensitive WhyLabs authentication information in a secure location and then reference the secret in the Data Validator configuration. To generate a WhyLabs access token, you can follow the official WhyLabs instructions documented here .

Then, you can register the whylogs Data Validator with WhyLabs logging capabilities as follows:

# Create the secret referenced in the data validator

zenml secret create whylabs_secret \

--whylabs_default_org_id=<YOUR-WHYLOGS-ORGANIZATION-ID> \

--whylabs_api_key=<YOUR-WHYLOGS-API-KEY>

# Register the whylogs data validator

zenml data-validator register whylogs_data_validator --flavor=whylogs \

--authentication_secret=whylabs_secret

You'll also need to enable whylabs logging for your custom pipeline steps if you want to upload the whylogs data profiles that they return as artifacts to the WhyLabs platform. This is enabled by default for the standard whylogs step. For custom steps, you can enable WhyLabs logging by setting the upload_to_whylabs parameter to True in the step configuration, e.g.:

from typing_extensions import Annotated  # or `from typing import Annotated on Python 3.9+

from typing import Tuple

import pandas as pd

import whylogs as why

from sklearn import datasets

from whylogs.core import DatasetProfileView

from zenml.integrations.whylogs.flavors.whylogs_data_validator_flavor import (

WhylogsDataValidatorSettings,

from zenml import step

@step(

settings={

"data_validator.whylogs": WhylogsDataValidatorSettings(

enable_whylabs=True, dataset_id="model-1"

def data_loader() -> Tuple[

Annotated[pd.DataFrame, "data"],