Skip to content

Commit

Permalink
fix: ruff lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondchuc committed Mar 12, 2024
1 parent 84cb412 commit 878fbd3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions examples/jsonld_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
}
"""
# import RDFLib and other things
import json
try:
from rdflib import Graph
except ModuleNotFoundError as e:
except ModuleNotFoundError:
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
Expand Down
2 changes: 1 addition & 1 deletion rdflib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2887,7 +2887,7 @@ def bind( # type: ignore[override]

def namespaces(self) -> Generator[Tuple[str, URIRef], None, None]:
if hasattr(self, "namespace_manager"):
for prefix, namespace in self.namespace_manager.namespaces(): # noqa: F402
for prefix, namespace in self.namespace_manager.namespaces():
yield prefix, namespace
else:
for graph in self.graphs:
Expand Down
2 changes: 1 addition & 1 deletion rdflib/plugins/sparql/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ def sparql_query_text(self, node):
elif node.name == "MultiplicativeExpression":
left_side = self.convert_node_arg(node.expr)
multiplication = left_side
for i, operator in enumerate(node.op): # noqa: F402
for i, operator in enumerate(node.op):
multiplication += (
operator + " " + self.convert_node_arg(node.other[i]) + " "
)
Expand Down
4 changes: 2 additions & 2 deletions test/test_literal/test_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
Literal(Decimal(-1.1)),
Literal(Decimal(-2.2)),
),
(18, Literal(float(-1)), Literal(float(-1.1)), Literal(float(-2.1))),
(19, Literal(float(-1.1)), Literal(float(-1.1)), Literal(float(-2.2))),
(18, Literal(float(-1)), Literal(-1.1), Literal(-2.1)),
(19, Literal(-1.1), Literal(-1.1), Literal(-2.2)),
(20, Literal(1), Literal(1.0), Literal(2.0)),
(21, Literal(1.0), Literal(1.0), Literal(2.0)),
(22, Literal(Decimal(1)), Literal(Decimal(1.0)), Literal(Decimal(2.0))),
Expand Down

0 comments on commit 878fbd3

Please sign in to comment.