Skip to content

Commit dfc8942

Browse files
authored
fix: correct type annotations and improve CI cache invalidation (#579)
- Fix incorrect **kwargs type annotation in elasticsearch.py (dict[str, int] -> Any) - Remove unnecessary type: ignore comments for imports now in pyproject.toml - Update CI pre-commit cache key to include uv.lock hash - Ensures MyPy re-checks files when dependencies change Fixes type errors introduced in #571 that were masked by stale CI cache. Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
1 parent 4cc75c8 commit dfc8942

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- uses: actions/cache@v4
3333
with:
3434
path: ~/.cache/pre-commit
35-
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
35+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml', 'uv.lock') }}
3636
- name: Install dependencies
3737
run: uv sync --frozen --all-extras --group dev
3838
- name: Check style and run tests

mellea/formatters/granite/retrievers/elasticsearch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
"""Classes and functions that implement the ElasticsearchRetriever."""
44

5+
from typing import Any
6+
57

68
class ElasticsearchRetriever:
79
"""Retriever for documents hosted on an ElasticSearch server."""
810

9-
def __init__(self, corpus_name: str, host: str, **kwargs: dict[str, int]):
11+
def __init__(self, corpus_name: str, host: str, **kwargs: Any):
1012
"""Initialize ElasticsearchRetriever.
1113
1214
:param hosts: Full url:port to the Elasticsearch server.

0 commit comments

Comments
 (0)