Skip to content

Commit 32bb01e

Browse files
committed
Fix ruff errors
1 parent ea4d99d commit 32bb01e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

fastapi_users_db_dynamodb/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"""
1313

1414
import uuid
15-
from typing import TYPE_CHECKING, Any, Generic, Optional
15+
from typing import TYPE_CHECKING, Any, Generic
1616

1717
from aiopynamodb.attributes import BooleanAttribute, NumberAttribute, UnicodeAttribute
1818
from aiopynamodb.exceptions import DeleteError, PutError
@@ -105,8 +105,8 @@ class Meta:
105105
id: ID
106106
oauth_name: str
107107
access_token: str
108-
expires_at: Optional[int]
109-
refresh_token: Optional[str]
108+
expires_at: int | None
109+
refresh_token: str | None
110110
account_id: str
111111
account_email: str
112112
else:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""FastAPI Users DynamoDB generics."""
22

33
import uuid
4-
from datetime import datetime, timezone
4+
from datetime import UTC, datetime
55

66
UUID_ID = uuid.UUID
77

@@ -11,4 +11,4 @@ def now_utc() -> datetime:
1111
Returns the current time in UTC with timezone awareness.
1212
Equivalent to the old implementation.
1313
"""
14-
return datetime.now(timezone.utc)
14+
return datetime.now(UTC)

fastapi_users_db_dynamodb/attributes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable
1+
from collections.abc import Callable
22

33
from aiopynamodb.attributes import Attribute, UnicodeAttribute
44
from aiopynamodb.constants import STRING

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import uuid
2-
from typing import Any, Optional
2+
from typing import Any
33

44
import pytest
55
from fastapi_users import schemas
@@ -8,11 +8,11 @@
88

99

1010
class User(schemas.BaseUser):
11-
first_name: Optional[str]
11+
first_name: str | None
1212

1313

1414
class UserCreate(schemas.BaseUserCreate):
15-
first_name: Optional[str]
15+
first_name: str | None
1616

1717

1818
class UserUpdate(schemas.BaseUserUpdate):

0 commit comments

Comments
 (0)