Skip to content

Commit

Permalink
cleanup json_schema_extras
Browse files Browse the repository at this point in the history
  • Loading branch information
brendancooley committed Oct 27, 2023
1 parent e0bf587 commit 22e0fef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_uniqueness_validation():
"""It should be able to validate uniqueness."""

class MyModel(pt.Model):
column: int = pt.Field(json_schema_extra={"unique": True})
column: int = pt.Field(unique=True)

non_duplicated_df = pt.DataFrame({"column": [1, 2, 3]})
MyModel.validate(non_duplicated_df)
Expand Down Expand Up @@ -346,7 +346,7 @@ def test_uniqueness_constraint_validation():
"""Uniqueness constraints should be validated."""

class UniqueModel(pt.Model):
product_id: int = pt.Field(json_schema_extra={"unique": True})
product_id: int = pt.Field(unique=True)

validate(dataframe=pl.DataFrame({"product_id": [1, 2]}), schema=UniqueModel)

Expand Down

0 comments on commit 22e0fef

Please sign in to comment.