Skip to content

Commit 3eac68c

Browse files
committed
checkpoint
1 parent aa10537 commit 3eac68c

File tree

5 files changed

+151
-87
lines changed

5 files changed

+151
-87
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ pep8-naming = ["-N802", "-N806", "-N815"]
105105
pycodestyle = ["-E402"]
106106
[tool.flakeheaven.exceptions."test/utils/namespace/_*"]
107107
pep8-naming = ["-N815"]
108+
[tool.flakeheaven.exceptions."rdflib/plugins/parsers/rdfxml.py"]
109+
pep8-naming = ["-N802"]
110+
[tool.flakeheaven.exceptions."rdflib/plugins/parsers/trix.py"]
111+
pep8-naming = ["-N802"]
112+
108113

109114

110115
[tool.black]

rdflib/plugins/parsers/jsonld.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,20 +460,23 @@ def _to_object(
460460
term: Optional[Term],
461461
node: Any,
462462
inlist: bool = False,
463-
):
463+
) -> Optional[Node]:
464464
if isinstance(node, tuple):
465465
value, lang = node
466466
if value is None:
467-
return
467+
# type error: Return value expected
468+
return # type: ignore[return-value]
468469
if lang and " " in lang:
469-
return
470+
# type error: Return value expected
471+
return # type: ignore[return-value]
470472
return Literal(value, lang=lang)
471473

472474
if isinstance(node, dict):
473475
node_list = context.get_list(node)
474476
if node_list is not None:
475477
if inlist and not self.allow_lists_of_lists:
476-
return
478+
# type error: Return value expected
479+
return # type: ignore[return-value]
477480
listref = self._add_list(dataset, graph, context, term, node_list)
478481
if listref:
479482
return listref
@@ -483,7 +486,8 @@ def _to_object(
483486
if term.type == JSON:
484487
node = self._to_typed_json_value(node)
485488
elif node is None:
486-
return
489+
# type error: Return value expected
490+
return # type: ignore[return-value]
487491
elif term.type == ID and isinstance(node, str):
488492
node = {ID: context.resolve(node)}
489493
elif term.type == VOCAB and isinstance(node, str):
@@ -492,7 +496,8 @@ def _to_object(
492496
node = {TYPE: term.type, VALUE: node}
493497
else:
494498
if node is None:
495-
return
499+
# type error: Return value expected
500+
return # type: ignore[return-value]
496501
if isinstance(node, float):
497502
return Literal(node, datatype=XSD.double)
498503

@@ -516,7 +521,8 @@ def _to_object(
516521
return None
517522
if lang:
518523
if " " in lang:
519-
return
524+
# type error: Return value expected
525+
return # type: ignore[return-value]
520526
return Literal(value, lang=lang)
521527
elif datatype:
522528
return Literal(value, datatype=context.expand(datatype))
@@ -549,7 +555,7 @@ def _add_list(
549555
context: Context,
550556
term: Optional[Term],
551557
node_list: Any,
552-
):
558+
) -> IdentifiedNode:
553559
if not isinstance(node_list, list):
554560
node_list = [node_list]
555561

0 commit comments

Comments
 (0)