aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-01-20 12:43:47 +0300
committerFrederick Muriuki Muriithi2023-01-20 12:43:47 +0300
commitb7b743001eae170792c5f533757fa40d86a9788a (patch)
tree68eed68fa2fdd828083b7f313445d7a89744d86f
parentf0745377da36b7060da86412f3f5b04b5d383877 (diff)
downloadgenenetwork3-b7b743001eae170792c5f533757fa40d86a9788a.tar.gz
mypy: minor fixes to typing errors
-rw-r--r--gn3/api/search.py4
-rw-r--r--gn3/auth/authentication/oauth2/models/oauth2client.py2
-rw-r--r--mypy.ini2
3 files changed, 5 insertions, 3 deletions
diff --git a/gn3/api/search.py b/gn3/api/search.py
index 866b040..0e832da 100644
--- a/gn3/api/search.py
+++ b/gn3/api/search.py
@@ -173,7 +173,9 @@ def parse_location_field(species_query: xapian.Query,
raise ValueError
location: tuple[Maybe[int], Maybe[int]]
if ".." in location_str:
- location = tuple(limit.map(apply_si_suffix) for limit in parse_range(location_str))
+ the_range = parse_range(location_str)
+ location = (the_range[0].map(apply_si_suffix), # type: ignore
+ the_range[1].map(apply_si_suffix)) # type: ignore
# If point location, assume +/- 50 kbases on either side.
else:
width = 50*10**3
diff --git a/gn3/auth/authentication/oauth2/models/oauth2client.py b/gn3/auth/authentication/oauth2/models/oauth2client.py
index ac3bdb1..70b8f59 100644
--- a/gn3/auth/authentication/oauth2/models/oauth2client.py
+++ b/gn3/auth/authentication/oauth2/models/oauth2client.py
@@ -135,7 +135,7 @@ def client(conn: db.DbConnection, client_id: uuid.UUID,
"SELECT * FROM oauth2_clients WHERE client_id=?", (str(client_id),))
result = cursor.fetchone()
the_user = user or user_by_id(conn, result["user_id"]).maybe(
- None, lambda usr: usr)
+ None, lambda usr: usr)# type: ignore
if result:
return Just(
OAuth2Client(uuid.UUID(result["client_id"]),
diff --git a/mypy.ini b/mypy.ini
index 1fcf703..ac7af77 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -55,5 +55,5 @@ ignore_missing_imports = True
[mypy-authlib.*]
ignore_missing_imports = True
-[mypy-pymonad.*]
+[mypy-pymonad.tools]
ignore_missing_imports = True