Skip to content

Commit 93bae2a

Browse files
committed
chore: Add some mypy ignores
1 parent ec4d5bf commit 93bae2a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

rdflib/plugins/sparql/algebra.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ def translateGroupGraphPattern(graphPattern: CompValue) -> CompValue:
335335
"""
336336

337337
if graphPattern.name == "SubSelect":
338-
return ToMultiSet(translate(graphPattern)[0])
338+
# The first output from translate cannot be None for a subselect query;
339+
# it can only be None for certain DESCRIBE queries.
340+
return ToMultiSet(translate(graphPattern)[0]) # type: ignore[arg-type]
339341

340342
if not graphPattern.part:
341343
graphPattern.part = [] # empty { }

rdflib/plugins/sparql/evaluate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def evalConstructQuery(ctx: QueryContext, query) -> Dict[str, Union[str, Graph]]
588588
def evalDescribeQuery(ctx: QueryContext, query) -> Dict[str, Union[str, Graph]]:
589589
# Create a result graph and bind namespaces from the graph being queried
590590
graph = Graph()
591-
for pfx, ns in ctx.graph.namespaces():
591+
for pfx, ns in ctx.graph.namespaces(): # type: ignore[union-attr]
592592
graph.bind(pfx, ns)
593593

594594
to_describe = set()
@@ -609,7 +609,7 @@ def evalDescribeQuery(ctx: QueryContext, query) -> Dict[str, Union[str, Graph]]:
609609

610610
# Get a CBD for all resources identified to describe
611611
for resource in to_describe:
612-
graph += ctx.graph.cbd(resource)
612+
graph += ctx.graph.cbd(resource) # type: ignore[union-attr]
613613

614614
res: Dict[str, Union[str, Graph]] = {}
615615
res["type_"] = "DESCRIBE"

0 commit comments

Comments
 (0)