Commit 3f32e82b authored by Jan Reimes's avatar Jan Reimes
Browse files

refactor(specs): update SpecQueryResult to use dataclass for defaults

* Changed SpecQueryResult to a dataclass for cleaner syntax.
* Set default for source_differences to an empty dictionary.
* Improved import organization in helpers.py by adding normalize_portal_meeting_name.
parent 30715b9c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import typer

from tdoc_crawler.crawlers import normalize_subgroup_alias, normalize_working_group_alias
from tdoc_crawler.database import TDocDatabase
from tdoc_crawler.specs.normalization import normalize_portal_meeting_name
from tdoc_crawler.http_client import download_to_path
from tdoc_crawler.models import CrawlLimits, HttpCacheConfig, MeetingQueryConfig, SortOrder, TDocMetadata, WorkingGroup

@@ -138,7 +139,7 @@ def collect_spec_numbers(specs: list[str] | None, spec_file: Path | None) -> lis
        return []

    # Import here to avoid circular imports
    from tdoc_crawler.specs.normalization import expand_spec_ranges_batch
    from tdoc_crawler.specs.normalization import expand_spec_ranges_batch, normalize_portal_meeting_name

    try:
        expanded = expand_spec_ranges_batch(collected)
+5 −1
Original line number Diff line number Diff line
@@ -73,6 +73,10 @@ class SpecQueryFilters:
    status: str | None = None


from dataclasses import dataclass, field


@dataclass
class SpecQueryResult:
    """Query result row for a spec."""

@@ -80,4 +84,4 @@ class SpecQueryResult:
    title: str | None = None
    status: str | None = None
    working_group: str | None = None
    source_differences: dict[str, dict[str, str | None]] | None = None
    source_differences: dict[str, dict[str, str | None]] = field(default_factory=dict)