--- id: chispa version: "0.12.0" license: MIT license_treatment: permissive maintenance: active --- # chispa — Pyspark test helper library License: permissive · Maintenance: active · Downloads: 3.0M/mo ## What it is and what it does Chispa is a testing library that simplifies writing unit tests by providing assertion methods like `assert_column_equality` and `assert_df_equality` that compare data structures while generating human-readable error messages that highlight mismatches. When a test fails, the output uses color-coding and formatted tables to show exactly which rows or values differ, making debugging much faster than reading raw error output. The library supports flexible comparison modes: you can ignore row order, column order, specific columns, nullable schema properties, and NaN equality. It integrates with pytest and is designed as a development dependency. The package is actively maintained, supports Python 3.10, 3.11, and 3.12, and carries no known security vulnerabilities. Use it for: - Write unit tests with clear assertion failures and readable error output. - Compare actual and expected data structures while ignoring row or column order. - Debug data quality issues by viewing formatted side-by-side comparisons of mismatched rows. - Test column-level transformations with descriptive failure messages. - Validate schema changes while ignoring nullable property differences. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides assertion methods for testing PySpark code with descriptive error messages formatted for easy debugging. Yes. Chispa is a lightweight, actively maintained testing utility with no security issues and low install friction. It directly addresses the pain point of making test failures readable and actionable. Install it as a development dependency if you write tests. ## Install pip install chispa uv add chispa poetry add chispa ## Installing chispa Before you install: Low friction install with a single runtime dependency (prettytable). Actively maintained with recent releases and no known vulnerabilities. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects. Quickstart: pip install chispa from chispa.column_comparer import assert_column_equality assert_column_equality(df, "actual_column", "expected_column") Requires a working Spark environment; not declared as a runtime dependency but is the package's primary use case. Verify before relying: - Whether Spark is an implicit dependency or must be installed separately. - Performance characteristics when comparing very large DataFrames. - Full list of assertion methods beyond column and DataFrame equality. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pyspark dataframe testing, spark test assertions, pyspark unit testing, dataframe equality comparison, spark test helpers, pyspark debugging output, spark column comparison, testing, pytest [View on SkillFed](https://skillfed.io/packages/chispa) · [View on PyPI](https://pypi.org/project/chispa/)