Skip to content

Commit

Permalink
Feature polars one (#272)
Browse files Browse the repository at this point in the history
* Verification for new polars implementation

* Added polars version into readme
  • Loading branch information
canimus authored Jul 6, 2024
1 parent 8d51514 commit d48656b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Provider | API | Versions
![bigquery](logos/bigquery.png?raw=true "BigQuery Client API")| `bigquery` | `3.4.1`
![pandas](logos/pandas.svg?raw=true "Pandas DataFrame API")| `pandas`| `2.0.2`, `1.5.x`, `1.4.x`
![duckdb](logos/duckdb.png?raw=true "DuckDB API")|`duckdb` | `0.10.2`,~~`0.9.2`~~,~~`0.8.0`~~, ~~`0.7.1`~~
![polars](logos/polars.svg?raw=true "Polars API")|`polars`| `0.19.6`
![polars](logos/polars.svg?raw=true "Polars API")|`polars`| `1.0.0`,~~`0.19.6`~~
![daft](logos/daft.png?raw=true "Daft API")|`daft`| `0.2.24`, ~~`0.2.19`~~

<sub>Logos are trademarks of their own brands.</sub>
Expand Down
2 changes: 1 addition & 1 deletion cuallee/polars_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def has_pattern(self, rule: Rule, dataframe: pl.DataFrame) -> Union[bool, int]:
"""Conformance on column values to regular expression threshold"""
return Compute._result(
dataframe.select(
operator.gt(pl.col(rule.column).str.count_match(rule.value), 0).cast(
operator.gt(pl.col(rule.column).str.count_matches(rule.value), 0).cast(
pl.Int8
)
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ duckdb = [
"duckdb==1.0.0"
]
polars = [
"polars>=0.19.6"
"polars>=1.0.0"
]
test = [
"pytest",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/polars_dataframe/test_has_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_negative(check: Check):
@pytest.mark.parametrize("extra_value", [4, 4.0], ids=("int", "float"))
def test_values(check: Check, extra_value):
check.has_mean("id", extra_value)
df = pl.DataFrame({"id": [0, 1, 2, 3, 14] + [extra_value]})
df = pl.DataFrame({"id": [0, 1, 2, 3, 14] + [extra_value]}, strict=False)
result = check.validate(df).select(pl.col("status")) == "PASS"
assert all(result.to_series().to_list())

Expand Down

0 comments on commit d48656b

Please sign in to comment.