From d11a5eff3d1ca99fa6d63d432e2a53f48a3394a4 Mon Sep 17 00:00:00 2001 From: Iwan Aucamp Date: Wed, 24 Aug 2022 21:00:53 +0200 Subject: feat: add type hints to `rdflib.query` and related (#2097) Add type hints to `rdflib.query` and result format implementations, also add/adjust ignores and type hints in other modules to accommodate the changes. This does not include any runtime changes. --- test/test_misc/test_plugins.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/test_misc/test_plugins.py') diff --git a/test/test_misc/test_plugins.py b/test/test_misc/test_plugins.py index 46147f5a..7263bc73 100644 --- a/test/test_misc/test_plugins.py +++ b/test/test_misc/test_plugins.py @@ -6,13 +6,14 @@ import sys import warnings from contextlib import ExitStack, contextmanager from pathlib import Path -from typing import Any, Callable, Dict, Generator, List +from typing import Any, Callable, Dict, Generator, List, cast import rdflib.plugin import rdflib.plugins.sparql import rdflib.plugins.sparql.evaluate from rdflib import Graph from rdflib.parser import Parser +from rdflib.query import ResultRow TEST_DIR = Path(__file__).parent.parent TEST_PLUGINS_DIR = TEST_DIR / "plugins" @@ -92,7 +93,7 @@ def test_sparqleval(tmp_path: Path, no_cover: None) -> None: logging.debug("query_string = %s", query_string) result = graph.query(query_string) assert result.type == "SELECT" - rows = list(result) + rows = cast(List[ResultRow], list(result)) logging.debug("rows = %s", rows) assert len(rows) == 1 assert len(rows[0]) == 1 -- cgit v1.2.1