Skip to content

Commit 5361ba5

Browse files
chore: pydantic 2
1 parent 70d1cbd commit 5361ba5

4 files changed

Lines changed: 1261 additions & 1002 deletions

File tree

fast_s3/file.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@ class Status(str, Enum):
1313
error = "error"
1414

1515

16-
class File(BaseModel):
16+
class File(BaseModel, arbitrary_types_allowed=True):
1717
buffer: io.BytesIO
1818
future: TransferFuture
1919
path: Union[str, Path]
2020
status: Status = Status.pending
2121
exception: Optional[Exception] = None
2222

23-
class Config:
24-
arbitrary_types_allowed = True
25-
2623
def with_status(self, status: Status, exception: Optional[Exception] = None):
27-
attributes = self.dict()
24+
attributes = dict(self)
2825
attributes.update(status=status, exception=exception)
2926
return File(**attributes)

fast_s3/uploader.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ class Status(str, Enum):
1313
error = "error"
1414

1515

16-
class Result(BaseModel):
16+
class Result(BaseModel, arbitrary_types_allowed=True):
1717
status: Status
1818
exception: Optional[Exception] = None
1919

20-
class Config:
21-
arbitrary_types_allowed = True
22-
2320

2421
class Uploader:
2522
def __init__(

0 commit comments

Comments
 (0)