mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-16 07:19:13 +08:00
Cast `url_for() output to str`
Starlette 0.26.0 has changed the return type of `HTTPConnection.url_for()`
from `str` to `URL`, which breaks the Galaxy package mypy tests:
```
mypy . --enable-incomplete-feature=Unpack
galaxy/webapps/galaxy/api/__init__.py:180: error: Incompatible types in
assignment (expression has type "str", variable has type "URL") [assignment]
url = f"{url}?{urlencode(query_params)}"
^
Found 1 error in 1 file (checked 255 source files)
```
This commit is contained in:
@@ -173,7 +173,7 @@ class UrlBuilder:
|
||||
query_params = path_params.pop("query_params", None)
|
||||
try:
|
||||
if qualified:
|
||||
url = self.request.url_for(name, **path_params)
|
||||
url = str(self.request.url_for(name, **path_params))
|
||||
else:
|
||||
url = self.request.app.url_path_for(name, **path_params)
|
||||
if query_params:
|
||||
|
||||
Reference in New Issue
Block a user