|
5 | 5 |
|
6 | 6 | ### Features |
7 | 7 |
|
8 | | -* add polars support ([f8ba5ef](https://github.com/getyourguide/dataframe-expectations/commit/f8ba5ef6932e84d83081da6971552ea972bab062)) |
| 8 | +* **Polars support** ([f8ba5ef](https://github.com/getyourguide/dataframe-expectations/commit/f8ba5ef6932e84d83081da6971552ea972bab062)) |
| 9 | + |
| 10 | + `dataframe-expectations` now supports [Polars](https://pola.rs/) DataFrames alongside Pandas and PySpark. Polars is an optional dependency and must be explicitly requested: |
| 11 | + |
| 12 | +``` |
| 13 | +pip install dataframe-expectations[polars] # pandas + polars |
| 14 | +pip install dataframe-expectations[pyspark,polars] # pandas + pyspark + polars |
| 15 | +``` |
| 16 | + |
| 17 | + |
| 18 | +All existing expectations that have a Polars implementation will automatically dispatch to the |
| 19 | +correct validation path when a Polars DataFrame is passed to a suite. |
| 20 | + |
| 21 | +Polars imports are fully deferred behind `@lru_cache` helpers (mirroring the PySpark pattern), |
| 22 | +so importing `dataframe_expectations` has zero overhead when Polars is not installed. |
| 23 | + |
| 24 | +* **Backward-compatible API for expectation authors** ([52dda74](https://github.com/getyourguide/dataframe-expectations/commit/52dda741fa5e3376dd4072a1d8dc1ece33ec8248)) |
| 25 | + |
| 26 | +The `fn_violations_polars` parameter on `ColumnExpectation` is optional (`None` by default), |
| 27 | +so existing custom expectations that only implement Pandas and/or PySpark continue to work |
| 28 | +without changes. `@abstractmethod` has been removed from `validate_pandas`, `validate_pyspark`, |
| 29 | +and `validate_polars` — each raises `NotImplementedError` by default, allowing expectation |
| 30 | +authors to implement only the backends they need. |
| 31 | + |
| 32 | +* **CI updated to cover Polars install scenarios** ([b636a15](https://github.com/getyourguide/dataframe-expectations/commit/b636a151b6aa9864723e9b11551533c0139d2538)) |
| 33 | + |
| 34 | +| Job | Extras installed | Tests run | |
| 35 | +|---|---|---| |
| 36 | +| `tests-without-optional` | None | `-m "not pyspark and not polars"` | |
| 37 | +| `tests-with-pyspark` | `[pyspark]` | `-m "not polars"` | |
| 38 | +| `tests-with-polars` | `[polars]` | `-m "not pyspark"` | |
| 39 | +| `tests-with-all` | `[pyspark,polars]` | All | |
| 40 | + |
| 41 | + |
| 42 | +### Bug Fixes |
| 43 | + |
| 44 | +* **Tightened DataFrame type checks** ([15d1df7](https://github.com/getyourguide/dataframe-expectations/commit/15d1df7a3e5b0d1aa397a562fef8ac5ae1c49e6b)) |
| 45 | + |
| 46 | +`is_polars_data_frame()` and `is_pyspark_data_frame()` no longer use `__module__` name |
| 47 | +fallbacks. Only actual `DataFrame` instances (via `isinstance`) are accepted, preventing |
| 48 | +`Series`, `Expr`, `LazyFrame`, `Column`, `Row`, etc. from being mis-routed into validation paths. |
| 49 | + |
| 50 | + |
| 51 | +### Documentation |
| 52 | + |
| 53 | +* **Getting Started guide updated with tabbed examples** ([ee53581](https://github.com/getyourguide/dataframe-expectations/commit/ee53581e1b8fe50ed296a476e43f010ca25e865a)) |
| 54 | + |
| 55 | +Installation and usage examples now use `sphinx-design` tab sets showing Pandas, PySpark, and |
| 56 | +Polars side-by-side. `sphinx-design>=0.6.0` added as a docs dependency. |
| 57 | + |
| 58 | + |
| 59 | +### Test Improvements |
| 60 | + |
| 61 | +* **Refactored test fixtures to use PyArrow** ([f9692bd](https://github.com/getyourguide/dataframe-expectations/commit/f9692bd)) |
| 62 | + |
| 63 | +Test data is now defined once via PyArrow tables and converted to Pandas, PySpark, or Polars |
| 64 | +DataFrames through a `dataframe_factory` fixture, eliminating duplicated test data across |
| 65 | +backends. All expectation tests are parametrized over `[pandas, pyspark, polars]`. |
| 66 | + |
| 67 | +* **Exhaustive `match/case` blocks** — all `match df_lib` blocks in tests now include |
| 68 | +`case _: pytest.fail(...)` to catch unhandled DataFrame types immediately. |
9 | 69 |
|
10 | 70 | ## [0.6.0](https://github.com/getyourguide/dataframe-expectations/compare/v0.5.2...v0.6.0) (2026-03-18) |
11 | 71 |
|
|
0 commit comments