From 596bb733673fe1c79384a5197c7820b843e38cd4 Mon Sep 17 00:00:00 2001 From: Johan Bergsma <29785380+JPBergsma@users.noreply.github.com> Date: Wed, 30 Nov 2022 15:01:40 +0100 Subject: [PATCH] Made changes to satisfy mypy. --- optimade/server/entry_collections/entry_collections.py | 2 +- optimade/server/routers/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/optimade/server/entry_collections/entry_collections.py b/optimade/server/entry_collections/entry_collections.py index 5af264148..2a39a94be 100644 --- a/optimade/server/entry_collections/entry_collections.py +++ b/optimade/server/entry_collections/entry_collections.py @@ -149,7 +149,7 @@ def find( exclude_fields = self.all_fields - response_fields - results = [self.resource_mapper.map_back(doc) for doc in raw_results] + results: List = [self.resource_mapper.map_back(doc) for doc in raw_results] self.check_and_add_missing_fields(results, response_fields) if results: diff --git a/optimade/server/routers/utils.py b/optimade/server/routers/utils.py index 761b6f9a1..3cad26124 100644 --- a/optimade/server/routers/utils.py +++ b/optimade/server/routers/utils.py @@ -260,7 +260,7 @@ def get_entries( links = ToplevelLinks(next=None) if exclude_fields: - results = remove_exclude_fields(results, exclude_fields) + results = remove_exclude_fields(results, exclude_fields) # type: ignore[assignment] return response( links=links, @@ -312,7 +312,7 @@ def get_single_entry( links = ToplevelLinks(next=None) if exclude_fields and results is not None: - results = remove_exclude_fields(results, exclude_fields)[0] + results = remove_exclude_fields(results, exclude_fields)[0] # type: ignore[assignment] return response( links=links,