Skip to content

Commit

Permalink
Merge pull request #67 from nakashima-hikaru/patch-1
Browse files Browse the repository at this point in the history
docs: Fix example usage
  • Loading branch information
thomasaarholt committed Apr 22, 2024
2 parents c3776ad + 22d2ffa commit ae2fd82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Patito allows you to specify the type of each column in your dataframe by creati

```py
# models.py
from typing import Literal, Optional
from typing import Literal

import patito as pt

Expand All @@ -74,7 +74,7 @@ df = pl.DataFrame(
)
try:
Product.validate(df)
except pt.ValidationError as exc:
except pt.exceptions.DataFrameValidationError as exc:
print(exc)
# 3 validation errors for Product
# is_for_sale
Expand Down Expand Up @@ -120,7 +120,7 @@ def num_products_for_sale(products: pl.DataFrame) -> int:
return products.filter(pl.col("is_for_sale")).height
```

The following test would fail with a `patito.ValidationError`:
The following test would fail with a `patito.exceptions.DataFrameValidationError`:

```py
def test_num_products_for_sale():
Expand Down

0 comments on commit ae2fd82

Please sign in to comment.