Skip to main content

DataKitchen's Data Quality DataOps TestGen

Project description

DataOps Data Quality TestGen

apache 2.0 license Badge PRs Badge Latest Version Docker Pulls Documentation Static Badge

DataOps Data Quality TestGen, or "TestGen" for short, can help you find data issues so you can alert your users and notify your suppliers. It does this by delivering simple, fast data quality test generation and execution by data profiling, new dataset screening and hygiene review, algorithmic generation of data quality validation tests, ongoing production testing of new data refreshes, and continuous anomaly monitoring of datasets. TestGen is part of DataKitchen's Open Source Data Observability.

Features

What does DataKitchen's DataOps Data Quality TestGen do? It helps you understand and find data issues in new data.

DatKitchen Open Source Data Quality TestGen Features - New Data

It constantly watches your data for data quality anomalies and lets you drill into problems.

DataKitchen Open Source Data Quality TestGen Features - Data Ingestion and Quality Testing

A single place to manage Data Quality across data sets, locations, and teams.

DataKitchen Open Source Data Quality TestGen Features - Single Place

Installation with dk-installer (recommended)

The dk-installer program installs DataOps Data Quality TestGen as a Docker Compose application. This is the recommended mode of installation as Docker encapsulates and isolates the application from other software on your machine and does not require you to manage Python dependencies.

Install the prerequisite software

Software Tested Versions Command to check version
Python
- Most Linux and macOS systems have Python pre-installed.
- On Windows machines, you will need to download and install it.
3.9, 3.10, 3.11, 3.12 python3 --version
Docker
Docker Compose
25.0.3, 26.1.1,
2.24.6, 2.27.0, 2.28.1
docker -v
docker compose version

Download the installer

On Unix-based operating systems, use the following command to download it to the current directory. We recommend creating a new, empty directory.

curl -o dk-installer.py 'https://raw.githubusercontent.com/DataKitchen/data-observability-installer/main/dk-installer.py'
  • Alternatively, you can manually download the dk-installer.py file from the data-observability-installer repository.
  • All commands listed below should be run from the folder containing this file.
  • For usage help and command options, run python3 dk-installer.py --help or python3 dk-installer.py <command> --help.

Install the TestGen application

The installation downloads the latest Docker images for TestGen and deploys a new Docker Compose application. The process may take 5~10 minutes depending on your machine and network connection.

python3 dk-installer.py tg install

The --port option may be used to set a custom localhost port for the application (default: 8501).

To enable SSL for HTTPS support, use the --ssl-cert-file and --ssl-key-file options to specify local file paths to your SSL certificate and key files.

Once the installation completes, verify that you can login to the UI with the URL and credentials provided in the output.

Optional: Run the TestGen demo setup

The Data Observability quickstart walks you through DataOps Data Quality TestGen capabilities to demonstrate how it covers critical use cases for data and analytic teams.

python3 dk-installer.py tg run-demo

In the TestGen UI, you will see that new data profiling and test results have been generated.

Installation with pip

As an alternative to the Docker Compose installation with dk-installer (recommended), DataOps Data Quality TestGen can also be installed as a Python package via pip. This mode of installation uses the dataops-testgen package published to PyPI, and it requires a PostgreSQL instance to be provisioned for the application database.

Install the prerequisite software

Software Tested Versions Command to check version
Python
- Most Linux and macOS systems have Python pre-installed.
- On Windows machines, you will need to download and install it.
3.10, 3.11, 3.12 python3 --version
PostgreSQL 14.1, 15.8, 16.4 psql --version

Install the TestGen package

We recommend using a Python virtual environment to avoid any dependency conflicts with other applications installed on your machine. The venv module, which is part of the Python standard library, or other third-party tools, like virtualenv or conda, can be used.

Create and activate a virtual environment with a TestGen-compatible version of Python (>=3.10). The steps may vary based on your operating system and Python installation - the Python packaging user guide is a useful reference.

On Linux/Mac

python3 -m venv venv
source venv/bin/activate

On Windows

py -3.10 -m venv venv
venv\Scripts\activate

Within the virtual environment, install the TestGen package with pip.

pip install dataops-testgen

Verify that the testgen command line works.

testgen --help

Set up the application database in PostgresSQL

Create a local.env file with the following environment variables, replacing the <value> placeholders with appropriate values. Refer to the TestGen Configuration document for more details, defaults, and other supported configuration.

# Connection parameters for the PostgreSQL server
export TG_METADATA_DB_HOST=<postgres_hostname>
export TG_METADATA_DB_PORT=<postgres_port>

# Connection credentials for the PostgreSQL server
# This role must have privileges to create roles, users, database and schema so that the application database can be initialized
export TG_METADATA_DB_USER=<postgres_username>
export TG_METADATA_DB_PASSWORD=<postgres_password>

# Set a password and arbitrary string (the "salt") to be used for encrypting secrets in the application database
export TG_DECRYPT_PASSWORD=<encryption_password>
export TG_DECRYPT_SALT=<encryption_salt>

# Set credentials for the default admin user to be created for TestGen
export TESTGEN_USERNAME=<username>
export TESTGEN_PASSWORD=<password>

# Set an accessible path for storing application logs
export TESTGEN_LOG_FILE_PATH=<path_for_logs>

Source the file to apply the environment variables. For the Windows equivalent, refer to this guide.

source local.env

Make sure the PostgreSQL database server is up and running. Initialize the application database for TestGen.

testgen setup-system-db --yes

Run the TestGen UI

Run the following command to start the TestGen UI. It will open the browser at http://localhost:8501.

testgen ui run

Verify that you can login to the UI with the TESTGEN_USERNAME and TESTGEN_PASSWORD values that you configured in the environment variables.

Optional: Run the TestGen demo setup

The Data Observability quickstart walks you through DataOps Data Quality TestGen capabilities to demonstrate how it covers critical use cases for data and analytic teams.

testgen quick-start --delete-target-db
testgen run-profile --table-group-id 0ea85e17-acbe-47fe-8394-9970725ad37d
testgen run-test-generation --table-group-id 0ea85e17-acbe-47fe-8394-9970725ad37d
testgen run-tests --project-key DEFAULT --test-suite-key default-suite-1
testgen quick-start --simulate-fast-forward

In the TestGen UI, you will see that new data profiling and test results have been generated.

Product Documentation

DataOps Data Quality TestGen

Useful Commands

The dk-installer and docker compose CLI can be used to operate the TestGen application installed using dk-installer. All commands must be run in the same folder that contains the dk-installer.py and docker-compose.yml files used by the installation.

Remove demo data

After completing the quickstart, you can remove the demo data from the application with the following command.

python3 dk-installer.py tg delete-demo

Upgrade to latest version

New releases of TestGen are announced on the #releases channel on Data Observability Slack, and release notes can be found on the DataKitchen documentation portal. Use the following command to upgrade to the latest released version.

python3 dk-installer.py tg upgrade

Uninstall the application

The following command uninstalls the Docker Compose application and removes all data, containers, and images related to TestGen from your machine.

python3 dk-installer.py tg delete

Access the testgen CLI

The testgen command line can be accessed within the running container.

docker compose exec engine bash

Use exit to return to the regular terminal.

Stop the application

docker compose down

Restart the application

docker compose up -d

What Next?

Getting started guide

We recommend you start by going through the Data Observability Overview Demo.

Support

For support requests, join the Data Observability Slack 👋 and post on the #support channel.

Connect to your database

Follow these instructions to improve the quality of data in your database.

Community

Talk and learn with other data practitioners who are building with DataKitchen. Share knowledge, get help, and contribute to our open-source project.

Join our community here:

Contributing

For details on contributing or running the project for development, check out our contributing guide.

License

DataKitchen's DataOps Data Quality TestGen is Apache 2.0 licensed.

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

dataops-testgen-2.15.2.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

dataops_testgen-2.15.2-py3-none-any.whl (4.4 MB view details)

Uploaded Python 3

File details

Details for the file dataops-testgen-2.15.2.tar.gz.

File metadata

  • Download URL: dataops-testgen-2.15.2.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for dataops-testgen-2.15.2.tar.gz
Algorithm Hash digest
SHA256 9e5f160d107aea3156773cdc881abac7b5af2baf60e57ab7cedde3caa3b6e88a
MD5 abb4764569d8db3177cae3d7074612b6
BLAKE2b-256 ffcece60a041def4b81b610832a9b62d5c498c4b73f8f7038bccd8d4e584aebe

See more details on using hashes here.

File details

Details for the file dataops_testgen-2.15.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dataops_testgen-2.15.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38629b420a43f19b249d6d133b094853a14dd22fe29196f8e3593db955c4f016
MD5 8d2ec4656bd7863064afd7f89f6101a0
BLAKE2b-256 25578a303de0fb6d02a2a3ff7ab373d35c5342aecc2d47e79a6c8cc4f84d7d5f

See more details on using hashes here.

Supported by

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