Skip to content

Commit d8d5bb7

Browse files
committed
add specific error code to # type: ignore
1 parent cfb1443 commit d8d5bb7

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

oaff/app/oaff/app/data/sources/postgresql/stac_hybrid/postgresql_data_source.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ async def get_feature_set_provider(
189189
await self.db.fetch_one(
190190
sa.select([sa.func.count()]).select_from(layer.model).where(filters)
191191
)
192-
)[
193-
0
194-
] # type: ignore
192+
)[0]
195193

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

@@ -225,7 +223,7 @@ async def _get_derived_layers(self) -> Dict[str, PostgresqlLayer]:
225223
bboxes=[table_spatial_extents[qualified_layer_name]],
226224
intervals=table_temporal_extents[qualified_layer_name]
227225
if qualified_layer_name in table_temporal_extents
228-
else [[None, None]], # type: ignore
226+
else [None, None],
229227
data_source_id=self.id,
230228
schema_name=tables[qualified_layer_name]["schema_name"],
231229
table_name=tables[qualified_layer_name]["table_name"],
@@ -416,7 +414,7 @@ async def _get_table_temporal_extents( # noqa: C901
416414
self,
417415
table_models: Dict[str, sa.Table],
418416
table_temporal_fields: Dict[str, List[TemporalInstant]],
419-
) -> Dict[str, List[datetime]]:
417+
) -> Dict[str, List[List[datetime]]]:
420418
table_temporal_extents = {} # type: ignore
421419
for qualified_table_name, temporal_fields in table_temporal_fields.items():
422420
start = None

oaff/app/oaff/app/request_handlers/collections_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
LOGGER: Final = getLogger(__file__)
1313

1414

15-
class CollectionsList(RequestHandler): # type: ignore
15+
class CollectionsList(RequestHandler): # type: ignore[no-redef]
1616
@classmethod
1717
def type_name(cls) -> str:
1818
return CollectionsList.__name__

oaff/app/oaff/app/request_handlers/conformance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from oaff.app.responses.response_format import ResponseFormat
88

99

10-
class Conformance(RequestHandler): # type: ignore
10+
class Conformance(RequestHandler): # type: ignore[no-redef]
1111
@classmethod
1212
def type_name(cls) -> str:
1313
return Conformance.__name__

oaff/app/oaff/app/request_handlers/landing_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from oaff.app.settings import OPENAPI_OGC_TYPE
1313

1414

15-
class LandingPage(RequestHandler): # type: ignore
15+
class LandingPage(RequestHandler): # type: ignore[no-redef]
1616
@classmethod
1717
def type_name(cls) -> str:
1818
return LandingPage.__name__

oaff/app/oaff/app/responses/response_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from oaff.app.responses.response_type import ResponseType
44

55

6-
class ResponseFormat(dict, Enum): # type: ignore
6+
class ResponseFormat(dict, Enum): # type: ignore[misc]
77
html = {
88
ResponseType.DATA: "text/html",
99
ResponseType.METADATA: "text/html",

oaff/fastapi/gunicorn/gunicorn.conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cpu_limit = os.environ.get("API_CPU_LIMIT")
44
if cpu_limit is None:
5-
num_avail_cpus = len(os.sched_getaffinity(0))
5+
num_avail_cpus = len(os.sched_getaffinity(0)) # type: ignore[attr-defined]
66
else:
77
try:
88
num_avail_cpus = int(cpu_limit)

0 commit comments

Comments
 (0)