Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chouinar committed Sep 19, 2024
1 parent e8f0f91 commit 65cc033
Show file tree
Hide file tree
Showing 31 changed files with 48 additions and 21 deletions.
1 change: 1 addition & 0 deletions api/src/adapters/db/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
For usage information look at the package docstring in __init__.py
"""

import abc
import logging

Expand Down
1 change: 1 addition & 0 deletions api/src/adapters/db/flask_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def health():
db_client = flask_db.get_db(current_app)
# db_client.get_connection() or db_client.get_session()
"""

from functools import wraps
from typing import Callable, Concatenate, ParamSpec, TypeVar

Expand Down
6 changes: 2 additions & 4 deletions api/src/api/schemas/extension/field_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ class Regexp(validators.Regexp):
)

@typing.overload
def __call__(self, value: str) -> str:
...
def __call__(self, value: str) -> str: ...

@typing.overload
def __call__(self, value: bytes) -> bytes:
...
def __call__(self, value: bytes) -> bytes: ...

def __call__(self, value: str | bytes) -> str | bytes:
if self.regex.match(value) is None: # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-08-10 15:52:10.626153
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-10-18 16:37:18.252136
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-11-27 14:43:04.227044
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-12-11 13:13:33.446941
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-01-29 14:07:42.665723
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-02-02 11:36:33.241412
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-02-07 12:16:16.564629
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-02-12 15:58:54.880550
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-02-21 13:44:50.932948
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-03-07 10:20:15.639825
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-03-07 10:44:08.694002
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-03-12 13:22:57.718265
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-04-16 13:36:35.993325
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-04-19 13:41:34.017203
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-04-24 15:27:13.602523
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-05-01 11:14:34.332661
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-05-02 10:11:35.832837
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-05-07 14:41:19.401963
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-05-09 15:06:48.010975
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-07-08 12:43:45.240782
"""

import sqlalchemy as sa
from alembic import op

Expand Down
14 changes: 8 additions & 6 deletions api/src/db/models/agency_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ class Agency(ApiSchemaTable, TimestampMixin):

assistance_listing_number: Mapped[str]

agency_submission_notification_setting: Mapped[
AgencySubmissionNotificationSetting
] = mapped_column(
"agency_submission_notification_setting_id",
LookupColumn(LkAgencySubmissionNotificationSetting),
ForeignKey(LkAgencySubmissionNotificationSetting.agency_submission_notification_setting_id),
agency_submission_notification_setting: Mapped[AgencySubmissionNotificationSetting] = (
mapped_column(
"agency_submission_notification_setting_id",
LookupColumn(LkAgencySubmissionNotificationSetting),
ForeignKey(
LkAgencySubmissionNotificationSetting.agency_submission_notification_setting_id
),
)
)

agency_contact_info_id: Mapped[BigInteger | None] = mapped_column(
Expand Down
8 changes: 4 additions & 4 deletions api/src/db/models/opportunity_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ class OpportunitySummary(ApiSchemaTable, TimestampMixin):
updated_by: Mapped[str | None]
created_by: Mapped[str | None]

link_funding_instruments: Mapped[
list["LinkOpportunitySummaryFundingInstrument"]
] = relationship(
back_populates="opportunity_summary", uselist=True, cascade="all, delete-orphan"
link_funding_instruments: Mapped[list["LinkOpportunitySummaryFundingInstrument"]] = (
relationship(
back_populates="opportunity_summary", uselist=True, cascade="all, delete-orphan"
)
)
link_funding_categories: Mapped[list["LinkOpportunitySummaryFundingCategory"]] = relationship(
back_populates="opportunity_summary", uselist=True, cascade="all, delete-orphan"
Expand Down
1 change: 0 additions & 1 deletion api/src/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
logger.info("message")
"""


import src.logging.config as config


Expand Down
1 change: 1 addition & 0 deletions api/src/logging/flask_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
flask_logger.init_app(logger, app)
"""

import logging
import time
import uuid
Expand Down
1 change: 1 addition & 0 deletions api/src/logging/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
See https://docs.python.org/3/library/logging.html#formatter-objects
"""

import json
import logging
from datetime import date, datetime
Expand Down
14 changes: 8 additions & 6 deletions api/src/task/opportunities/set_current_opportunities_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ def _process_opportunity(self, opportunity: Opportunity) -> None:
"existing_opportunity_status": opportunity.opportunity_status,
}
log_extra |= get_log_extra_for_summary(
opportunity.current_opportunity_summary.opportunity_summary
if opportunity.current_opportunity_summary
else None,
(
opportunity.current_opportunity_summary.opportunity_summary
if opportunity.current_opportunity_summary
else None
),
"existing",
)
logger.info("Processing opportunity %s", opportunity.opportunity_id, extra=log_extra)
Expand Down Expand Up @@ -245,9 +247,9 @@ def is_opportunity_changed(
def get_log_extra_for_summary(summary: OpportunitySummary | None, prefix: str) -> dict[str, Any]:
return {
f"{prefix}_opportunity_summary_id": summary.opportunity_summary_id if summary else None,
f"{prefix}_opportunity_summary_revision_number": summary.revision_number
if summary
else None,
f"{prefix}_opportunity_summary_revision_number": (
summary.revision_number if summary else None
),
f"{prefix}_opportunity_summary_is_forecast": summary.is_forecast if summary else None,
f"{prefix}_opportunity_summary_post_date": summary.post_date if summary else None,
f"{prefix}_opportunity_summary_close_date": summary.close_date if summary else None,
Expand Down
1 change: 1 addition & 0 deletions api/tests/lib/db_testing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Helper functions for testing database code."""

import contextlib
import logging

Expand Down
1 change: 1 addition & 0 deletions api/tests/src/db/models/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
The factories are based on the `factory_boy` library. See
https://factoryboy.readthedocs.io/en/latest/ for more information.
"""

import random
from datetime import datetime
from typing import Optional
Expand Down

0 comments on commit 65cc033

Please sign in to comment.