Skip to content

Commit

Permalink
add specific error code to # type: ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
underchemist committed Sep 27, 2021
1 parent cfb1443 commit d8d5bb7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ async def get_feature_set_provider(
await self.db.fetch_one(
sa.select([sa.func.count()]).select_from(layer.model).where(filters)
)
)[
0
] # type: ignore
)[0]

return PostgresqlFeatureSetProvider(self.db, id_set, layer, total_count)

Expand Down Expand Up @@ -225,7 +223,7 @@ async def _get_derived_layers(self) -> Dict[str, PostgresqlLayer]:
bboxes=[table_spatial_extents[qualified_layer_name]],
intervals=table_temporal_extents[qualified_layer_name]
if qualified_layer_name in table_temporal_extents
else [[None, None]], # type: ignore
else [None, None],
data_source_id=self.id,
schema_name=tables[qualified_layer_name]["schema_name"],
table_name=tables[qualified_layer_name]["table_name"],
Expand Down Expand Up @@ -416,7 +414,7 @@ async def _get_table_temporal_extents( # noqa: C901
self,
table_models: Dict[str, sa.Table],
table_temporal_fields: Dict[str, List[TemporalInstant]],
) -> Dict[str, List[datetime]]:
) -> Dict[str, List[List[datetime]]]:
table_temporal_extents = {} # type: ignore
for qualified_table_name, temporal_fields in table_temporal_fields.items():
start = None
Expand Down
2 changes: 1 addition & 1 deletion oaff/app/oaff/app/request_handlers/collections_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
LOGGER: Final = getLogger(__file__)


class CollectionsList(RequestHandler): # type: ignore
class CollectionsList(RequestHandler): # type: ignore[no-redef]
@classmethod
def type_name(cls) -> str:
return CollectionsList.__name__
Expand Down
2 changes: 1 addition & 1 deletion oaff/app/oaff/app/request_handlers/conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from oaff.app.responses.response_format import ResponseFormat


class Conformance(RequestHandler): # type: ignore
class Conformance(RequestHandler): # type: ignore[no-redef]
@classmethod
def type_name(cls) -> str:
return Conformance.__name__
Expand Down
2 changes: 1 addition & 1 deletion oaff/app/oaff/app/request_handlers/landing_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from oaff.app.settings import OPENAPI_OGC_TYPE


class LandingPage(RequestHandler): # type: ignore
class LandingPage(RequestHandler): # type: ignore[no-redef]
@classmethod
def type_name(cls) -> str:
return LandingPage.__name__
Expand Down
2 changes: 1 addition & 1 deletion oaff/app/oaff/app/responses/response_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from oaff.app.responses.response_type import ResponseType


class ResponseFormat(dict, Enum): # type: ignore
class ResponseFormat(dict, Enum): # type: ignore[misc]
html = {
ResponseType.DATA: "text/html",
ResponseType.METADATA: "text/html",
Expand Down
2 changes: 1 addition & 1 deletion oaff/fastapi/gunicorn/gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cpu_limit = os.environ.get("API_CPU_LIMIT")
if cpu_limit is None:
num_avail_cpus = len(os.sched_getaffinity(0))
num_avail_cpus = len(os.sched_getaffinity(0)) # type: ignore[attr-defined]
else:
try:
num_avail_cpus = int(cpu_limit)
Expand Down

0 comments on commit d8d5bb7

Please sign in to comment.