From 45031b14c1d9b2e544119237cab53b43b6c9ee63 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 4 Mar 2026 18:19:48 -0600 Subject: [PATCH] fix: correct type annotations and improve CI cache invalidation - 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 --- .github/workflows/quality.yml | 2 +- mellea/formatters/granite/retrievers/elasticsearch.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 2e343d4f2..22c47ff3c 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/cache@v4 with: path: ~/.cache/pre-commit - key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml', 'uv.lock') }} - name: Install dependencies run: uv sync --frozen --all-extras --group dev - name: Check style and run tests diff --git a/mellea/formatters/granite/retrievers/elasticsearch.py b/mellea/formatters/granite/retrievers/elasticsearch.py index 56c8f211d..5fed87807 100644 --- a/mellea/formatters/granite/retrievers/elasticsearch.py +++ b/mellea/formatters/granite/retrievers/elasticsearch.py @@ -2,11 +2,13 @@ """Classes and functions that implement the ElasticsearchRetriever.""" +from typing import Any + class ElasticsearchRetriever: """Retriever for documents hosted on an ElasticSearch server.""" - def __init__(self, corpus_name: str, host: str, **kwargs: dict[str, int]): + def __init__(self, corpus_name: str, host: str, **kwargs: Any): """Initialize ElasticsearchRetriever. :param hosts: Full url:port to the Elasticsearch server.