Skip to main content

table-validator

Cross-platform data migration validator. Compares a source table against a target Databricks table/catalog and reports whether the migration is correct: matching schema, row counts, column statistics, and (where a difference is found) the exact row/column that changed. Produces a multi-sheet Excel report and a pass/fail summary.

Currently supported sources (target is always Databricks):

  • Databricks catalog → Databricks catalog
  • Azure Blob Storage (CSV / Excel / Parquet) → Databricks table
  • Azure SQL Database → Databricks catalog

More source platforms can be added behind the same connector/validator interfaces described below.

Install

pip install table-validator

From a local checkout (the directory containing pyproject.toml):

pip install .

For local development (editable install, so code changes take effect without reinstalling):

pip install -e ".[dev]"

Either way, this installs the tablevalidator command on your PATH.

CLI usage

tablevalidator info

Prints what the tool does and the commands below, in the order you'd normally run them.

tablevalidator configure

Interactive wizard that walks you through:

  1. Azure Storage account + container (optional, skip if you don't have a Blob source) and account key
  2. Azure SQL server + database (optional, skip if you don't have a SQL source) and username/password
  3. Databricks workspace URL, SQL Warehouse HTTP path, and personal access token
  4. Source table (catalog / schema / table)
  5. Target table (catalog / schema / table)
  6. Which validations to run (catalog / schema / column / row)
tablevalidator validate

Runs the comparison using the saved configuration and writes validation_report.xlsx in the current directory, printing a pass/fail summary to the console. Exit code is 0 if the overall result is PASS, non-zero otherwise (useful in CI). Useful flags:

tablevalidator validate --config-path /path/to/config.yaml --output /path/to/report.xlsx
tablevalidator open

Opens the most recently generated report in your default spreadsheet app.

Quickstart (Python API)

Everything the CLI does is available as a library, built from the same public API exported by table_validator/__init__.py:

from table_validator import (
    load_config,
    CatalogValidator,
    CatalogValidationRequest,
    DatabricksConnector,
)
from table_validator.auth.databricks_auth import get_databricks_token

# Non-secret settings from ~/.table_validator/config.yaml
# (see `tablevalidator configure`); secrets from ~/.table_validator/.env.
config = load_config()
token = get_databricks_token(config)

# DatabricksConnector wants a bare hostname, not the full workspace URL
host = config.databricks.workspace_url.replace("https://", "").split("/")[0]

databricks = DatabricksConnector(
    host=host,
    token=token,
    http_path=config.databricks.http_path,
)

validator = CatalogValidator(databricks)

request = CatalogValidationRequest(
    source_catalog="source_catalog_name",
    target_catalog="target_catalog_name",
    schemas=["sales"],          # optional: restrict scope
    primary_keys={"sales.orders": ["order_id"]},  # optional: enables row-level diffing
)

result = validator.compare_catalogs(request)

print(result.status)  # PASS / FAIL / ERROR / SKIPPED

Other public entry points exported from table_validator:

  • AzureCsvValidator / AzureSqlValidator — the Blob-CSV and Azure-SQL equivalents of CatalogValidator, returning the same CatalogValidationResponse shape.
  • BlobCatalogValidator — validates every file in an Azure Blob container against like-named Databricks tables.
  • AzureConnector / AzureSqlConnector — the Azure-side connectors, for building your own validation flow against a connector directly.
  • ValidatorConfig, default_config, save_config, require_config, ConfigNotFoundError — the same config load/save layer the CLI wizard uses, if you want to construct or persist configuration programmatically.

Where config and secrets are stored

Everything lives outside the repo, under your home directory:

  • ~/.table_validator/config.yaml — non-secret configuration (table references, workspace URL, which validations are enabled). Safe to inspect or version-control separately if you want.
  • ~/.table_validator/.env — credentials (Azure Storage key, Azure SQL username/password, Databricks personal access token), written in plaintext and restricted to owner read/write only (chmod 600, best-effort on Windows since NTFS doesn't map POSIX permission bits). Never commit this file or add it inside the project repo — it isn't, by construction, since it's written under your home directory rather than the working directory.

Optional: DATABRICKS_RETRY_TIMEOUT_SECONDS (a plain environment variable, not part of config.yaml) raises the CloudFetch HTTP retry timeout above its 300-second default. On a slow or unstable network, downloading a large row-hash result set can legitimately take longer than that, causing a Retry request would exceed Retry policy max retry duration failure even though the query itself succeeded. Set it higher (e.g. 900 for 15 minutes) if you hit this on large tables.

A future version will replace manual credential entry with Azure CLI / Service Principal auth and Databricks CLI / OAuth login, without changing the config file format or any command usage above.

Development

pip install -e ".[dev]"
pytest

License

MIT — see LICENSE.

Metadata

Release files for table-validator 0.1.3

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

Source distribution (sdist)

Source distribution for table-validator 0.1.3
File Size Uploaded Provenance Actions
table_validator-0.1.3.tar.gz 130.0 kB With provenance Details for table_validator-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for table-validator 0.1.3
File Interpreter ABI Platform Actions
table_validator-0.1.3-py3-none-any.whl Python 3 none any Details for table_validator-0.1.3-py3-none-any.whl

Total release size: 236.3 kB

Release files / table_validator-0.1.3.tar.gz

Download URL table_validator-0.1.3.tar.gz
Size 130.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3bfa449966c79b8c2057d8038c74f76f2fe8cdcb43c480063b52b7700d5ab164
BLAKE2b-256 checksum
How to use checksums
33872fe03a8a1f0e680f233fd732a07e7ae04e36170b9a079c0271becd4e4ca5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release files / table_validator-0.1.3-py3-none-any.whl

Download URL table_validator-0.1.3-py3-none-any.whl
Size 106.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1f8ad20585e578629459553ea8ac14b660ccba6476c0a8489cf34f20cfcbfcd
BLAKE2b-256 checksum
How to use checksums
259abbc8ea00227eb4cf5f4ab6737ad9d43d055f462c01d8559ae76814082a24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Security for table-validator 0.1.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for table_validator-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

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