-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt config. Replace None unions with Optional. Remove unnecessary f…
…iles.
- Loading branch information
Showing
26 changed files
with
64 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class CourseDTO(BaseModel): | ||
id: int | ||
name: str | None = None | ||
description: str | None = None | ||
name: Optional[str] = None | ||
description: Optional[str] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class ImageMessageContentDTO(BaseModel): | ||
image_data: str | None = Field(alias="imageData", default=None) | ||
image_data: Optional[str] = Field(alias="imageData", default=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from pydantic import BaseModel, Field, Json | ||
from typing import Any | ||
from typing import Any, Optional | ||
|
||
|
||
class JsonMessageContentDTO(BaseModel): | ||
json_content: Json[Any] | None = Field(alias="jsonContent", default=None) | ||
json_content: Optional[Json[Any]] = Field(alias="jsonContent", default=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
from datetime import datetime | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class LectureUnitDTO(BaseModel): | ||
id: int | ||
lecture_id: int = Field(alias="lectureId") | ||
release_date: datetime | None = Field(alias="releaseDate", default=None) | ||
name: str | None = None | ||
release_date: Optional[datetime] = Field(alias="releaseDate", default=None) | ||
name: Optional[str] = None | ||
attachment_version: int = Field(alias="attachmentVersion") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class TextMessageContentDTO(BaseModel): | ||
text_content: str | None = Field(alias="textContent", default=None) | ||
text_content: Optional[str] = Field(alias="textContent", default=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class UserDTO(BaseModel): | ||
id: int | ||
first_name: str | None = Field(alias="firstName", default=None) | ||
last_name: str | None = Field(alias="lastName", default=None) | ||
first_name: Optional[str] = Field(alias="firstName", default=None) | ||
last_name: Optional[str] = Field(alias="lastName", default=None) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class PyrisModelDTO(BaseModel): | ||
id: str | ||
name: str | ||
description: str | None = None | ||
description: Optional[str] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
from typing import Literal | ||
from typing import Literal, Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
from app.domain.status.stage_state_dto import StageStateDTO | ||
from app.domain.status.stage_state_dto import StageStateEnum | ||
|
||
|
||
class StageDTO(BaseModel): | ||
name: str | None = None | ||
name: Optional[str] = None | ||
weight: int | ||
state: Literal[ | ||
StageStateDTO.NOT_STARTED, | ||
StageStateDTO.IN_PROGRESS, | ||
StageStateDTO.DONE, | ||
StageStateDTO.SKIPPED, | ||
StageStateDTO.ERROR, | ||
] | ||
message: str | None = None | ||
state: StageStateEnum | ||
message: Optional[str] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from typing import Optional | ||
|
||
from ...domain.status.status_update_dto import StatusUpdateDTO | ||
|
||
|
||
class TutorChatStatusUpdateDTO(StatusUpdateDTO): | ||
result: str | None = None | ||
result: Optional[str] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from ..routers.health import router as health_router | ||
from ..routers.models import router as models_router | ||
from ..routers.pipelines import router as pipelines_router | ||
from ..routers.webhooks import router as webhooks_router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
from fastapi import APIRouter, status, Response | ||
from fastapi import APIRouter, status, Response, Depends | ||
|
||
from app.dependencies import TokenValidator | ||
|
||
router = APIRouter(prefix="/api/v1/health", tags=["health"]) | ||
|
||
|
||
@router.get("/") | ||
@router.get( | ||
"/", | ||
dependencies=[Depends(TokenValidator())], | ||
) | ||
def health_check(): | ||
return Response(status_code=status.HTTP_501_NOT_IMPLEMENTED) | ||
return Response(status_code=status.HTTP_200_OK) |
Oops, something went wrong.