Skip to content

Commit

Permalink
fix(appellate_docket): Added missing type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
albertisfu committed Dec 31, 2024
1 parent 7803d48 commit a1d3db4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions juriscraper/pacer/appellate_docket.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import re
import sys
from collections import OrderedDict
from typing import Optional
from typing import Any, Dict, List, Optional

from lxml import html
from lxml.etree import _ElementUnicodeResult

from ..lib.judge_parsers import normalize_judge_string
from ..lib.log_tools import make_default_logger
Expand Down Expand Up @@ -633,9 +634,10 @@ def _get_pacer_seq_no_from_tr(row: html.HtmlElement) -> Optional[str]:

return None

def _get_attachments(self, cells):
def _get_attachments(
self, cells: html.HtmlElement
) -> List[Dict[str, Any]]:
rows = cells.xpath("./table//tr//tr")[1:]

result = []
for row in rows:
attachment = {
Expand Down Expand Up @@ -701,7 +703,7 @@ def docket_entries(self):
de["pacer_doc_id"] = self._get_pacer_doc_id(cells[1])
pacer_seq_no = self._get_pacer_seq_no(cells[1])
if pacer_seq_no is not None:
de["pacer_seq_no"] = pacer_seq_no
de["pacer_seq_no"] = str(pacer_seq_no)
if not de["document_number"]:
if de["pacer_doc_id"]:
# If we lack the document number, but have
Expand Down Expand Up @@ -742,7 +744,9 @@ def _get_pacer_doc_id(cell):
return get_pacer_doc_id_from_doc1_url(doc1_url)

@staticmethod
def _get_pacer_seq_no(cell):
def _get_pacer_seq_no(
cell: html.HtmlElement,
) -> Optional[_ElementUnicodeResult]:
"""Take a row from the attachment table and return the input value by
index.
"""
Expand Down

0 comments on commit a1d3db4

Please sign in to comment.