Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lxml = {version = "^4.3.0", optional = true}
[tool.poetry.group.dev.dependencies]
black = "23.1.0"
isort = "^5.10.0"
mypy = "1.0.1"
mypy = "^1.1.0"
lxml-stubs = "^0.4.0"

[tool.poetry.group.tests.dependencies]
Expand Down
3 changes: 2 additions & 1 deletion rdflib/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ def _urlopen(req: Request) -> Any:
# This custom error handling should be removed once all
# supported versions of python support 308.
if ex.code == 308:
req.full_url = ex.headers.get("Location")
# type error: Incompatible types in assignment (expression has type "Optional[Any]", variable has type "str")
req.full_url = ex.headers.get("Location") # type: ignore[assignment]
return _urlopen(req)
else:
raise
Expand Down
4 changes: 2 additions & 2 deletions rdflib/plugins/sparql/aggregates.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, aggregation: CompValue):
self.expr = aggregation.vars
if not aggregation.distinct:
# type error: Cannot assign to a method
self.use_row = self.dont_care # type: ignore[assignment]
self.use_row = self.dont_care # type: ignore[method-assign]
self.distinct = False
else:
self.distinct = aggregation.distinct
Expand Down Expand Up @@ -184,7 +184,7 @@ def __init__(self, aggregation: CompValue):
self.value: Any = None
# DISTINCT would not change the value for MIN or MAX
# type error: Cannot assign to a method
self.use_row = self.dont_care # type: ignore[assignment]
self.use_row = self.dont_care # type: ignore[method-assign]

def set_value(self, bindings: MutableMapping[Variable, Identifier]) -> None:
if self.value is not None:
Expand Down
5 changes: 3 additions & 2 deletions rdflib/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ class ResultRow(Tuple["Identifier", ...]):
def __new__(
cls, values: Mapping["Variable", "Identifier"], labels: List["Variable"]
):
# type error: Generator has incompatible item type "Optional[Any]"; expected "_T_co"
instance = super(ResultRow, cls).__new__(cls, (values.get(v) for v in labels)) # type: ignore[misc]
# type error: Value of type variable "Self" of "__new__" of "tuple" cannot be "ResultRow" [type-var]
# type error: Generator has incompatible item type "Optional[Identifier]"; expected "_T_co" [misc]
instance = super(ResultRow, cls).__new__(cls, (values.get(v) for v in labels)) # type: ignore[type-var, misc]
instance.labels = dict((str(x[1]), x[0]) for x in enumerate(labels))
return instance

Expand Down
3 changes: 2 additions & 1 deletion test/test_graph/test_graph_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def test_3xx(self) -> None:
httpmock.mocks[MethodName.GET].assert_called()
assert len(httpmock.requests[MethodName.GET]) == 10
for request in httpmock.requests[MethodName.GET]:
assert re.match(r"text/turtle", request.headers.get("Accept"))
# type error: Argument 2 to "match" has incompatible type "Optional[Any]"; expected "str"
assert re.match(r"text/turtle", request.headers.get("Accept")) # type: ignore[arg-type]

request_paths = [
request.path for request in httpmock.requests[MethodName.GET]
Expand Down