File tree Expand file tree Collapse file tree
src/api/endpoints/annotate/_shared Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55Create Date: 2026-02-15 12:57:34.550327
66
77"""
8- from typing import Sequence , Union
8+ from typing import Optional , Sequence , Union
99
1010from alembic import op
1111
1212from src .util .alembic_helpers import switch_enum_type
1313
1414# revision identifiers, used by Alembic.
1515revision : str = '1fb2286a016c'
16- down_revision : Union [str , None ] = '759ce7d0772b'
16+ down_revision : Optional [str ] = '759ce7d0772b'
1717branch_labels : Union [str , Sequence [str ], None ] = None
1818depends_on : Union [str , Sequence [str ], None ] = None
1919
2020
2121def 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
4041def downgrade () -> None :
42+ """Remove internet_archive from batch_strategy enum."""
4143 op .execute ("""
4244 DELETE FROM BATCHES
4345 WHERE STRATEGY = 'internet_archive'
Original file line number Diff line number Diff 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 = \
You can’t perform that action at this time.
0 commit comments