Skip to content

Commit

Permalink
fix(pydantic): update validator and types to avoid deprecationwarning
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Oct 8, 2023
1 parent c9eed95 commit 80c8442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion monopoly/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class PdfPage:
pix_map: fitz.Pixmap
raw_text: str
image: Image
image: object

@property
def lines(self) -> list:
Expand Down
4 changes: 2 additions & 2 deletions monopoly/statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from functools import cached_property

from pandas import DataFrame
from pydantic import validator
from pydantic import field_validator
from pydantic.dataclasses import dataclass

from monopoly.config import StatementConfig, arbitrary_config
Expand All @@ -20,7 +20,7 @@ class Transaction:
description: str
amount: float

@validator("amount", pre=True)
@field_validator("amount", mode="before")
def adjust_number_format(cls, value: object) -> object:
if isinstance(value, str):
return value.replace(",", "")
Expand Down

0 comments on commit 80c8442

Please sign in to comment.