diff options
author | nicholascar <nicholas.car@surroundaustralia.com> | 2021-12-07 19:40:59 +1000 |
---|---|---|
committer | nicholascar <nicholas.car@surroundaustralia.com> | 2021-12-07 19:40:59 +1000 |
commit | 8e8071c8d1ce9db2216a7cdf83643027870417e1 (patch) | |
tree | 92e670e1c96bff223b59d8288f79200313492871 | |
parent | 2de6cf2aa3e4610613a10648f7c2d05629c8a37a (diff) | |
download | rdflib-8e8071c8d1ce9db2216a7cdf83643027870417e1.tar.gz |
ignore Flake Error W505 as soon it won't be considered an error
-rw-r--r-- | .flake8 | 2 | ||||
-rw-r--r-- | rdflib/plugins/parsers/hext.py | 4 | ||||
-rw-r--r-- | rdflib/plugins/serializers/xmlwriter.py | 4 | ||||
-rw-r--r-- | test/test_parser_hext.py | 2 |
4 files changed, 7 insertions, 5 deletions
@@ -4,3 +4,5 @@ extend-ignore = # E501: line too long # Disabled so that black can control line length. E501, + # Ignored since this is soon not going to be considered an error, see https://www.flake8rules.com/rules/W503.html + W503, diff --git a/rdflib/plugins/parsers/hext.py b/rdflib/plugins/parsers/hext.py index 06ae9b1e..d30641ca 100644 --- a/rdflib/plugins/parsers/hext.py +++ b/rdflib/plugins/parsers/hext.py @@ -5,7 +5,7 @@ handle contexts, i.e. multiple graphs. """ import json -from typing import List +from typing import List, Optional from rdflib.parser import Parser from rdflib import ConjunctiveGraph, URIRef, Literal, BNode import warnings @@ -26,7 +26,7 @@ class HextuplesParser(Parser): def _load_json_line(self, line: str): return [x if x != "" else None for x in json.loads(line)] - def _parse_hextuple(self, cg: ConjunctiveGraph, tup: List[str]): + def _parse_hextuple(self, cg: ConjunctiveGraph, tup: List[Optional[str, None]]): # 1 - subject if tup[0].startswith("_"): s = BNode(value=tup[0].replace("_:", "")) diff --git a/rdflib/plugins/serializers/xmlwriter.py b/rdflib/plugins/serializers/xmlwriter.py index b0f1a06e..99d1e767 100644 --- a/rdflib/plugins/serializers/xmlwriter.py +++ b/rdflib/plugins/serializers/xmlwriter.py @@ -100,8 +100,8 @@ class XMLWriter(object): for pre, ns in self.extra_ns.items(): if uri.startswith(ns): if pre != "": - return ":".join(pre, uri[len(ns) :]) + return ":".join(pre, uri[len(ns):]) else: - return uri[len(ns) :] + return uri[len(ns):] return self.nm.qname_strict(uri) diff --git a/test/test_parser_hext.py b/test/test_parser_hext.py index 50d09fc0..3253922f 100644 --- a/test/test_parser_hext.py +++ b/test/test_parser_hext.py @@ -111,4 +111,4 @@ def test_roundtrip(): if __name__ == "__main__": - test_roundtrip() + test_small_file_multigraph() |