Skip to content

Commit ce224d4

Browse files
committed
Fix pydantic upgrade issues
1 parent 10b102b commit ce224d4

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.mega-linter.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ PYTHON_RUFF_CONFIG_FILE: "pyproject.toml"
4242
REPOSITORY_DEVSKIM_ARGUMENTS: ["-g", ".mypy_cache/*"]
4343
SHOW_ELAPSED_TIME: true
4444
SPELL_MISSPELL_FILTER_REGEX_EXCLUDE: '(\.automation/generated|docs/descriptors)'
45-
YAML_YAMLLINT_FILTER_REGEX_EXCLUDE: '(templates/\.mega-linter\.yml/tests/**\/tests\/**)'
46-
YAML_PRETTIER_FILTER_REGEX_EXCLUDE: '(templates/\.mega-linter\.yml|mkdocs\.yml)'
45+
YAML_YAMLLINT_FILTER_REGEX_EXCLUDE: '(templates/|\.mega-linter\.yml|/tests/**)'
46+
YAML_PRETTIER_FILTER_REGEX_EXCLUDE: '(templates/|\.mega-linter\.yml|mkdocs\.yml)'
4747
YAML_V8R_FILTER_REGEX_EXCLUDE: '(descriptors|templates/\.mega-linter\.yml|\.codecov\.yml)'

main.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,8 @@
110110

111111
# Sentry monitoring
112112
if "SENTRY_DSN" in os.environ:
113-
# pylint: disable=abstract-class-instantiated
114113
sentry_sdk.init(
115114
dsn=os.getenv("SENTRY_DSN"),
116-
request_bodies="medium",
117115
environment=os.getenv("RUN_ENV", "development"),
118116
)
119117

@@ -128,7 +126,8 @@
128126

129127
# Start up our job scheduler on FastAPI startup and schedule jobs as needed
130128
@api.on_event("startup")
131-
async def startup_event() -> None: # noqa: D103
129+
async def startup_event() -> None:
130+
"""Startup events for the FastAPI application."""
132131
messages = await app.client.chat_scheduledMessages_list()
133132
for message in messages["scheduled_messages"]:
134133
await app.client.chat_deleteScheduledMessage(
@@ -171,7 +170,8 @@ async def base_endpoint(req: Request) -> Response: # noqa: D103
171170

172171

173172
@api.get("/healthz")
174-
async def healthz() -> Response: # noqa: D103
173+
async def healthz() -> Response:
174+
"""Health check endpoint for Render."""
175175
return Response(status_code=200)
176176

177177

modules/airtable/mentorship_tables.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
"""This module contains the Airtable tables for the mentorship program.""" # noqa: D404
1+
"""Airtable tables for the mentorship program."""
22
import logging
33
from functools import cached_property
44
from itertools import chain
55
from typing import Any
66

7-
from pydantic.error_wrappers import ValidationError
7+
from pydantic import ValidationError
88

99
from modules.airtable.shared_table import BaseAirtableTable
1010
from modules.models.mentorship_models import (
@@ -48,9 +48,9 @@ def parse_affiliation_row(row: dict[str, Any]) -> MentorshipAffiliation:
4848
airtable_id=row["id"],
4949
created_at=row["createdTime"],
5050
)
51-
except ValidationError as validation_exception:
51+
except ValidationError:
5252
logger.exception("Error parsing affiliation row", extra={"row": row})
53-
raise validation_exception from validation_exception
53+
raise
5454

5555

5656
class MentorshipMentorsTable(BaseAirtableTable):

modules/airtable/scheduled_message_table.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
from typing import Any
44

5-
from pydantic.error_wrappers import ValidationError
5+
from pydantic import ValidationError
66

77
from modules.airtable.shared_table import BaseAirtableTable
88
from modules.models.scheduled_message_models import ScheduledMessageInfo

0 commit comments

Comments
 (0)