Skip to content

Commit

Permalink
Ensure ol_index are actually python ints not signed int32 or something
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon-dxw committed Jan 7, 2025
1 parent f715dc0 commit a0cb118
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
rev: v0.8.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.2
rev: v1.96.3
hooks:
- id: terraform_fmt

Expand All @@ -33,7 +33,7 @@ repos:
args: ["markdown", "table", "--output-file", "README.md", "./terraform"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
name: mypy-src
Expand Down
5 changes: 4 additions & 1 deletion src/legislation_extraction/legislation_matcher_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ def resolve_overlap(results_dict):

# for every detected pair of refs that overlap
for ol_index in overlaps:
# mypy was complaining about ol_index being a `list[signedinteger[_32Bit | _64Bit]]`
# so just force it to be a regular list of ints
int_ol_index = list(map(int, ol_index))
# get those two rows
overlap_rows = qq.iloc[list(ol_index)]
overlap_rows = qq.iloc[int_ol_index]
# get the worst of the two (or first, if they're equal)
worst_match_index = overlap_rows.confidence.idxmin()
# and mark its index for deletion
Expand Down

0 comments on commit a0cb118

Please sign in to comment.