Getting Started with Data Quality as Code
This guide will help you install the Collate Python SDK and configure authentication to start running data quality tests programmatically.
Prerequisites
Before you begin, ensure you have:- Python 3.10 or higher installed
- pip package manager
- Access to an Collate instance (version 1.11.0 or later)
- A JWT token for authentication (see Authentication below)
Installation
Install theopenmetadata-ingestion package with the necessary extras for your use case:
Basic Installation
Installation with Database Connectors
Install additional dependencies based on the databases you’ll be testing:Installation with DataFrame Support
If you plan to use DataFrame validation features:Installation with Multiple Features
Combine multiple extras as needed:Authentication
Data Quality as Code requires authentication with your Collate instance. The SDK supports JWT token authentication.Getting a JWT Token
Obtain a JWT token in one of two ways:Note: The Bots tile under Settings is only visible to users with Admin privileges. If you don’t see it, ask your organization’s Collate Admin to generate a bot token for you or grant you Admin access.
Option 1: Using an Existing Bot Token
Collate provides pre-configured bots like theingestion-bot:
- Log in to Collate platform.
- Click the Profile icon and navigate to Settings > Bots.
- Find and click the ingestion-bot.
-
Copy and save the JWT token for later use.

Option 2: Creating a Custom Bot
For production use, create a dedicated bot with specific permissions:- Log in to Collate platform.
- Click the Profile icon and navigate to Settings > Bots.
- Click Add Bot and fill in the following fields:
- Email (required): Enter the bot’s email address.
- Display Name: Enter a display name for the bot.
- Token Expiration (required): Select how long the JWT token should remain valid.
- Allow Impersonation: Leave this off unless the bot needs to act on behalf of users. This setting can only be changed at creation time.
- Description: Optionally add a description for the bot.
- Click Create and slect the bot you created from the list.
- Assign appropriate roles (typically
DefaultBotPolicyandIngestion Bot Policy).
- Copy and save the generated JWT token.
Configuring the SDK
Once you have a JWT token, configure the SDK in your Python code:Using Environment Variables
For better security, letconfigure pick them up from environment variables:
Configuration Parameters
Theconfigure() function accepts the following parameters:
Verify Installation
Create a simple test to verify your setup:"your_service.database.schema.table" with the fully qualified name of an actual table in your Collate instance.
Your First Data Quality Test
Now that you’re set up, let’s run your first data quality test:Common Installation Issues
Connection Timeout
If you experience connection timeouts, verify:- Collate instance is running and accessible
- API URL is correct (should end with
/api) - Network connectivity between your script and Collate
- Firewall rules allow the connection
Import Errors
If you encounter import errors:Next Steps
Now that you have the SDK installed and configured:- Learn how to run table-level tests using the TestRunner API
- Explore DataFrame validation for ETL pipelines
- Review the complete test definitions reference