Skip to content

Commit fa0df7f

Browse files
style: fix flake8 annotations from PR check (Police-Data-Accessibility-Project#566)
1 parent 0b35097 commit fa0df7f

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

alembic/versions/2026_02_15_1257-1fb2286a016c_add_internet_archive_to_batch_strategy_.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
Create Date: 2026-02-15 12:57:34.550327
66
77
"""
8-
from typing import Sequence, Union
8+
from typing import Optional, Sequence, Union
99

1010
from alembic import op
1111

1212
from src.util.alembic_helpers import switch_enum_type
1313

1414
# revision identifiers, used by Alembic.
1515
revision: str = '1fb2286a016c'
16-
down_revision: Union[str, None] = '759ce7d0772b'
16+
down_revision: Optional[str] = '759ce7d0772b'
1717
branch_labels: Union[str, Sequence[str], None] = None
1818
depends_on: Union[str, Sequence[str], None] = None
1919

2020

2121
def upgrade() -> None:
22+
"""Add internet_archive to batch_strategy enum."""
2223
switch_enum_type(
2324
table_name="batches",
2425
column_name="strategy",
@@ -38,6 +39,7 @@ def upgrade() -> None:
3839

3940

4041
def downgrade() -> None:
42+
"""Remove internet_archive from batch_strategy enum."""
4143
op.execute("""
4244
DELETE FROM BATCHES
4345
WHERE STRATEGY = 'internet_archive'

src/api/endpoints/annotate/_shared/extract.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,25 @@ async def extract_and_format_get_annotation_result(
2626
url: URL,
2727
batch_id: int | None = None
2828
) -> GetNextURLForAllAnnotationResponse:
29+
"""Extract and format the annotation result for a URL."""
2930
with _phase("format_s"):
3031
html_response_info = DTOConverter.html_content_list_to_html_response_info(
3132
url.html_content
3233
)
3334
# URL Types
34-
url_type_suggestions: list[URLTypeAnnotationSuggestion] = \
35+
url_type_suggestions: list[URLTypeAnnotationSuggestion] = (
3536
convert_user_url_type_suggestion_to_url_type_annotation_suggestion(
3637
url.user_url_type_suggestions,
37-
url.anon_url_type_suggestions
38+
url.anon_url_type_suggestions,
3839
)
40+
)
3941
# Record Types
40-
record_type_suggestions: RecordTypeAnnotationResponseOuterInfo = \
42+
record_type_suggestions: RecordTypeAnnotationResponseOuterInfo = (
4143
convert_user_record_type_suggestion_to_record_type_annotation_suggestion(
4244
url.user_record_type_suggestions,
43-
url.anon_record_type_suggestions
45+
url.anon_record_type_suggestions,
4446
)
47+
)
4548
# Agencies
4649
with _phase("agency_suggestions_s"):
4750
agency_suggestions: AgencyAnnotationResponseOuterInfo = \

0 commit comments

Comments
 (0)