When data quality as code with the OpenMetadata Python SDK fits your team
Data quality as code fits teams whose pipeline owners want checks reviewed in pull requests and run as part of every load, not only clicked together in the OpenMetadata UI. If your data engineers already keep transformations in Git, run them through CI, and expect a failed check to block a deployment or page someone, then test definitions should follow the same path. The OpenMetadata Python SDK and REST APIs let a team run tests from inside an ETL job or against a dataframe, and publish the outcome back to the catalog. Those results then sit on the same table and column pages where lineage, ownership and glossary terms already live, so a reviewer looking at a failing asset sees the upstream pipeline, the owner and the history in one place.
This approach suits data engineers, platform teams and analytics engineering groups that manage many pipelines and want test logic versioned alongside the code that produces the data. Platform teams benefit when they need one consistent way to run checks across several projects. It does not replace the UI or the other test-management paths. Ad hoc investigation, business users adding simple checks, and bulk review of large test sets may still fit better in the UI, YAML or CSV workflows covered elsewhere on this page. Confirm with your own environment which SDK version and OpenMetadata release your team will pin, because the SDK and server must be compatible and 2.0 introduced breaking changes that affect ingestion images and connector credentials.
Before committing, ask three questions. Who will own the test definitions and approve changes in review? Which jobs must fail hard when a check fails, and which should only record a result for triage? Who receives the alert when a published failure appears, and does your incident routine cover it? Also confirm that the service account running the job has the permissions it needs to create and update test results, since a job that cannot publish results will show a passing pipeline while the catalog goes stale. Treat these answers as the design brief, because they decide how much of the work is code, how much is platform setup and how much is operating routine.
How test definitions, ETL jobs and the catalog connect
The flow starts in a Git repository, where test definitions live as reviewed code. The ETL or CI job loads those definitions, runs them through the OpenMetadata Python SDK against a warehouse table or a dataframe, and sends test cases and results to the OpenMetadata server. The trust boundary sits between the job runner and the server, and the JWT token for the ingestion bot crosses it, so check where that token is stored, who can read it from the runner, and which role it holds before you go live.
Test definitions flow from Git through the job runner into the catalog.
Where the test runs and when each placement fits
This table compares four places a data quality test can run: inside the ETL job against a dataframe, as a separate step after load, in a scheduled suite run, or only in the UI. Read each row to see what the placement catches, what it needs to run, who owns it and what it costs to keep working. Most teams combine two placements, with pre-load checks blocking bad data and post-load or scheduled checks confirming what landed in the warehouse.
| Placement | What it catches | What it needs | Who owns it and ongoing cost |
|---|---|---|---|
| In-job assertion on a dataframe before load | Schema drift, null spikes, out-of-range values and duplicate keys in the batch before it reaches the warehouse | Python runtime in the job image, the OpenMetadata SDK and a server connection, plus the batch in memory | Data engineers who own the pipeline. Ongoing cost is mostly test maintenance and extra job runtime |
| Separate test step after load against the warehouse table | Problems that appear only after load, such as row counts against source, referential gaps or values changed by downstream SQL | Warehouse read credentials, network access from the runner to the warehouse, and compute to run the queries | Data engineers with input from the table owner. Ongoing cost includes warehouse query spend on each run |
| Scheduled job running test suites | Quality drift on tables that change outside any single pipeline, such as upstream tables loaded by other teams | A scheduler such as Apache Airflow or cron, credentials scoped to read-only access, and a stable test suite definition | Platform or data team that runs the scheduler. Ongoing cost is scheduler capacity and warehouse query load |
| Tests defined only in the UI | Whatever the platform's built-in tests cover, with results visible on the asset page | Access to the OpenMetadata UI and the right role to create or edit tests | Catalog administrators or asset owners. Low operating cost, but definitions are not kept in version control unless exported |
How to version-control OpenMetadata test definitions in Git
Keep OpenMetadata test definitions in the same Git repository as the pipeline code that produces the tables they check. When a column is renamed, a load window changes or a threshold is tightened, the test change and the pipeline change should land in one reviewed pull request. That gives the team a history of who changed a quality rule and why, and lets a rollback restore the test and the code that depends on it together. Store the Python scripts that create or update tests in a directory such as quality/tests/, with one module per data product so ownership in code review maps to ownership in the catalog. Any test that lives only in the UI cannot be reviewed this way, so agree on a rule that every enabled test traces back to a file in the repository.
Pin the openmetadata-ingestion SDK version to the same release line as your OpenMetadata server, and record that pin in the repository's dependency file. Mismatched client and server versions can change how test definitions are serialized or which fields the API accepts, so an upgrade of the server should be a planned change that bumps the pin in the same branch as the server upgrade. Check the OpenMetadata 2.0 release notes before moving to a new major line, because the release notes list breaking changes, including the Great Expectations 1.3 migration that must happen before upgrading. Confirm the exact SDK package name and version with your vendor documentation rather than assuming it matches the server tag.
Keep environment-specific values out of the test definitions. Service names, host names, credentials and OpenMetadata server URLs belong in environment configuration loaded at run time, such as a per-environment settings file or CI secrets, so the same test file runs unchanged in development and production. Use a branch-based flow: tests are written and run against a development OpenMetadata instance from a feature branch, merged to a main branch after review, then deployed to production by the same pipeline that deploys the ETL job. Because the catalog is stateful, the deployment step should be idempotent so re-running it updates existing test cases instead of creating duplicates. Bulk definition formats for hundreds of tests are covered in the YAML and CSV topic, so use that guidance for large imports rather than duplicating it here.
What goes wrong when quality checks move into code
Moving checks from the catalog UI into Python jobs adds failure points that sit between the job, the SDK, the server and the catalog. The cards below cover the failures we see most often, and each one names the check to put in place before the first production run.
SDK and server version drift
The Python SDK in the job image and the OpenMetadata server can fall out of step after one side is upgraded. Calls may fail, or fields may be silently ignored. Pin the SDK version in the job's dependency file, record the server version next to it, and check both during every upgrade. OpenMetadata 2.0 also changed ingestion image requirements, so confirm the SDK line you pin matches the server you run.
Tests defined in code but never enabled
A test created by a script can exist in the catalog without being scheduled, attached to the right asset, or visible to the owning team. The code looks correct, but nothing runs or alerts. After each deployment, query the catalog for the test cases the job should have created and confirm each one is active and linked to a table. Treat a missing test as a failed deployment, not a warning.
Duplicate test cases from repeated runs
If the job creates test cases on every run without checking for existing ones, retries and reruns multiply them. Results then split across copies, and the dashboard shows the same failure many times. Use a deterministic test name derived from the table and the check, look it up before creating it, and make creation idempotent so that a rerun updates instead of adding.
Blocking failures with no triage owner
A check that fails inside an ETL job can stop a load, but if no owner is set on the table or test, the failure goes to a shared channel and waits. Decide in advance whether a failed check should halt the load or only record a result. Assign an owner on every table the job writes to, and route failures to that owner before the check is allowed to block production.
Credentials hard-coded in job scripts
Database passwords and OpenMetadata tokens written directly into job files end up in version control, container images and build logs. Load the server URL and bot token from the job's secret store at runtime, scope the token to the minimum role the job needs, and rotate it on a set schedule. Check the repository history for any secret that was committed before the move.
Read the sourceResults attached to the wrong table
Test results land on the wrong asset when the fully qualified name in the job does not match the name the connector registered in the catalog, for example because of case, schema prefix or service name differences. The check passes or fails, but the signal appears on an asset nobody watches. Build the name from the catalog's own fully qualified name, and verify that the result appears on the intended asset page after the first run.
Setup sequence for running OpenMetadata tests from Python
This sequence takes a team from an unconfigured Python environment to test definitions that run in a non-production job and show their results on the asset page and in the incident list. Each step ends with a check so that problems surface before any production data or catalog record is changed.
Confirm the server version and matching SDK
The platform engineer or data platform lead records the exact OpenMetadata server version running in the non-production environment and installs the Python SDK release that matches it. Check the release notes for the server version before choosing the SDK, since breaking changes are documented per release and the 2.0 line changed ingestion image and Python requirements. Done means the SDK version is pinned in the repository's dependency file and the team has written down the server version it was tested against.
Create a dedicated service identity
An administrator creates a bot or service account used only by the test job and grants it the narrowest permissions the calls need: reading table metadata, creating or editing test cases and suites, and writing test results. Avoid reusing a personal account or an administrator role. Confirm the permission set against the policy model in your server version, and ask your administrator to verify it because the exact role names depend on configuration. Done means the identity exists, and a read call for one known table succeeds while a write to an unrelated entity is refused.
Store the token in the secret store
The engineer generates the access token for the service identity and places it in the CI or scheduler secret store, such as the store your orchestrator or CI platform provides. The token must not appear in the repository, job logs or container images. The job reads the server address and token from environment variables at runtime. Done means a test run prints no token value in its logs, and the team can name who can rotate the token and how rotation is triggered.
Connect and confirm with a read call
Before any write, the engineer initializes the SDK client with the server address and the stored token, then calls a read endpoint to fetch one known table entity by its fully qualified name. The engineer checks that the returned owner, domain and columns match what the catalog shows in the interface. Done means the read returns the expected entity and an incorrect token produces an authentication error, which confirms the credential is actually being checked.
Define one test suite per table
The data engineer creates a folder in the repository with one test definition file per table, each naming the table's fully qualified name, its test cases and their parameters. Keep the file set under version control and review changes through the same pull request process as pipeline code. Run the definitions against a non-production copy of the table first. Done means every file parses, each referenced table exists in the catalog, and a dry run lists the expected test cases without writing anything.
Run the job in a non-production environment
The engineer schedules or triggers the job in a non-production environment that points at a non-production catalog and warehouse. Set the job to fail on any test failure so that quality problems stop the pipeline in the same way code failures do. Keep the run small at first, with a few tables, before widening the set. Done means the job completes, exit status matches the test outcomes, and the run logs name each test case it executed.
Verify results on the asset page and incident list
The engineer opens the asset page for each table in the catalog and checks that the new test results appear with the expected pass and fail status and timestamp. For a deliberately failing test in the non-production run, confirm that an incident is created and appears in the incident list with the expected owner. Ask the catalog administrator to confirm the incident routing, since owner and notification settings depend on your configuration. Done means each tested table shows its results, and at least one failure produces an incident that a named owner can see.
Security and operational controls for test jobs
Test jobs that run from Python pipelines touch the catalog, the warehouse and the results that describe both. The controls below decide who can change a test, which identity runs it, and what the failure output reveals. Check each one before the first scheduled run.
Runner credential handling
The job runner needs an OpenMetadata credential to publish test results, and the warehouse credential to read the data under test. Keep both in your secrets manager, inject them at runtime, and never commit them to the repository that holds the test definitions. Confirm that job logs do not echo the connection configuration when a test fails, since a failing run is when that output is most often captured.
Least-privilege service identity
Create a dedicated service identity for test jobs rather than reusing a personal account or an administrator token. Grant it the rights to read the target tables and write test results, and nothing that edits ownership, glossary terms or the test library. Confirm the exact permission set against the security documentation for your server version before you grant it.
OpenMetadata security docsWho changes tests in code and in the catalog
A test defined in the repository and a test edited in the UI can describe the same check differently, and the next job run decides which one wins. Decide which path is authoritative for each test, restrict UI edits to the owning team, and block direct changes to production test cases outside code review. Write this decision down so on-call engineers know where to look first.
Audit trail for code-driven changes
Changes pushed through the SDK are attributed to the identity that made them, so the job identity must be unique and traceable. Pair catalog history with pull request history in Git, and require that every test definition change maps to a reviewed commit. Ask your team to confirm how long each system keeps its records, because retention is set by your deployment and your repository host, not by the test code.
Network paths from runners to the API
Runners need a route to the OpenMetadata server and a route to the warehouse, and neither should go through a public endpoint by default. Place runners in the same network zone as the server or on a private path, terminate TLS at the server, and restrict egress from the runner to those two destinations. Confirm the server hostname and certificate chain with your platform team before the first job.
Authentication matched to the server
OpenMetadata does not support combining SSO with basic authentication at the same time. Find out which mechanism the server is configured for, then build the job's authentication to match it, typically a service token rather than an interactive SSO login. A job written for the wrong mechanism fails on every run, and the failure often looks like a permissions problem.
Test results as operational data
Failure messages can include table names, column names and sample values taken from the data under test. Treat these results as operational data with the same access rules as the tables themselves. Review what the failure output contains, limit who can view sample rows, and avoid pasting results into chat channels that include people outside the data access group.
What to confirm before committing to code-based tests
Before any code-based test is scoped or estimated, the team should confirm three things against the OpenMetadata documentation for the exact version in use: which test definitions can run against an in-memory dataframe and which need a warehouse table, how the SDK identifies an existing test case so that re-running a job does not create duplicates, and whether the version's ingestion and test integrations behave as the team expects. The 2.0 release notes are the natural starting point, since they describe the upgrade effects. Read the OpenMetadata 2.0 release notes and the current OpenMetadata documentation side by side, then record the answers in the project design. This page does not assert which test types or duplicate-handling behaviors your version supports, and those answers should not be taken from a blog post or from this page.
The release notes list breaking changes that affect code-based tests directly. Ingestion images move to Python 3.12, so any custom ingestion image has to be rebuilt, and the notes say Great Expectations must be migrated to version 1.3 before upgrading. Confirm which Python version your job runtime uses, whether it can run the SDK version you plan to pin, and whether your Great Expectations code needs changes. Also confirm how the 2.0 move to Apache Airflow 3.3.0 affects any job that triggers tests from a DAG. If a runtime is older than the documented requirement, the upgrade is a separate work item with its own testing, and it should be costed before the test suite is built.
Write these checks into the scoping document as explicit items with an owner and a sign-off, not as assumptions. Ask the implementation partner to show the test-by-test support matrix for your version, the duplicate-detection method and a sample job run in a non-production environment. Treat any capability the documentation does not confirm as out of scope until it is proven in a test environment.
Questions teams ask before running data quality as code
Does defining tests in Python take more effort than defining them in the OpenMetadata UI?
Usually it takes more up-front effort, and less ongoing effort once the suite grows. Writing tests in Python means your engineers build the test runner, the code review path and the environment setup before the first test runs, while a UI-defined test takes minutes to create. The payoff is that test definitions sit in version control, go through review like any other code, and can be copied across environments without manual clicks. The effort grows with the number of tables and pipelines covered, the number of environments that need the same tests, and how much custom test logic you write. Ask any partner to split their estimate into setup work and per-table work so you can see where the hours go.
How long does a first data quality as code integration take, and what drives it?
No fixed duration applies because it depends on your environment, so treat any single figure from a vendor with caution. The main drivers are the number of pipelines that run tests, whether those pipelines already run in Python, how many environments (development, staging, production) need matching tests, and how much custom SQL or dataframe logic you need to express. Access work also adds time, including service accounts, network paths to the OpenMetadata server and secret storage for API tokens. Ask for a written scope that lists each pipeline, environment and custom test, with a milestone for the first pipeline running end to end before the rest of the estimate is accepted.
What does this work need from our data and platform teams?
Your data engineers need to supply the pipelines, table names, business rules that define a passing result, and the owners who should receive failures. Your platform team needs to provide a running OpenMetadata instance, a service account with a scoped API token, network access from the job runners to the OpenMetadata API, and a place to store secrets such as tokens and database credentials. Your security team should review which identities can create or change tests. Confirm the current OpenMetadata version and SDK version with your platform team before starting, because the Python SDK and server must match.
Can our in-house team build data quality as code without outside help?
Yes, if your team already writes Python ETL jobs, maintains a CI system and operates an OpenMetadata instance. The harder parts are usually not the SDK calls but the decisions around them: which tests belong in which job, how failures should block or warn, how test definitions are reviewed, and how upgrades are tested before they reach production. Teams without a Python data engineering practice or without someone who owns the OpenMetadata deployment often benefit from an outside partner for the first pipeline. Ask any partner to hand over the code, the runbook and a walkthrough, so the work stays with your team.
What should a quote for this work include?
A quote should follow from a written scope that names the pipelines, environments, tables and custom tests in scope, along with the OpenMetadata version and deployment model. Ask for the deliverables in writing: the test definitions in version control, the Python job changes, the result-publishing code, a runbook, and a handover session. Ask which costs are one-time (design, build, handover) and which recur (retainers for upgrades, retesting and support). Also confirm what is excluded, such as changes to source systems, new connectors or work on alerting and incident routing. DeployOpen does not publish a price list, so a quote is the way to compare.
How do OpenMetadata upgrades affect our test jobs?
Upgrades can break test jobs if the SDK and server versions drift apart, so pin the SDK to the version that matches your server and retest before upgrading production. The 2.0 release has breaking changes that matter here, including a rebuilt ingestion image on Python 3.12 and a required Great Expectations migration to 1.3 before upgrading. Keep test definitions in version control so you can diff them against the new release, and run the suite in a staging environment first. Read the OpenMetadata 2.0 release notes and the maintenance release notes before each upgrade window.
What happens to test results if a job fails before publishing them?
If the job fails before it publishes, OpenMetadata receives no result for that run, so the asset page shows no new outcome for it, which can look like a pass if nobody checks. Design the pipeline so a missing run is itself an alert, for example by monitoring the last successful publish time for each suite. Separate failures in the test logic from failures in connectivity or credentials, because the second kind often hides quality problems. Decide in advance whether a failed test should stop the pipeline, mark data as untrusted or only raise an incident, and record that decision in the test code so reviewers can see it.
How DeployOpen scopes and delivers data quality as code
DeployOpen plans and builds data quality as code with the OpenMetadata Python SDK inside your own infrastructure. Each engagement starts with a written scope covering which ETL jobs and dataframes are in play, then moves through a version-controlled build, a documented handover and optional ongoing support.
How we scope
- We inventory the Python ETL jobs and dataframe workflows where tests should run, and the OpenMetadata assets they write to
- We agree which test definitions, owners and result-publishing paths are in the written scope before work starts
- We confirm the OpenMetadata version, deployment model and SDK version your team will run, so the build targets a known release
How we build
- We wire test execution into your existing Python jobs so failures surface in the pipeline and in the catalog
- We store test definitions in your Git repository with code review, so changes to quality rules follow the same process as code
- We test the integration against representative data in a non-production environment before it touches production tables
How we hand over
- We document how each test is defined, versioned, run and where its results appear on the asset page
- We walk your data engineers through adding a new test, reviewing a failing run and rolling back a definition change
- We deliver runbooks for credentials, SDK upgrades and the checks your team must repeat after each OpenMetadata release
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, scoped in writing
- Retainers can cover SDK and OpenMetadata version upgrades, including checks against the release notes for breaking changes
- Engagements are fixed-scope, so you receive a quote that follows directly from the written scope, with no published price list

