Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Mar 17, 2023
1 parent ad94fa0 commit dec7db6
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
from collections import defaultdict
from distutils.version import Version
from itertools import chain
from typing import Any, Iterable, Optional, cast

Expand Down Expand Up @@ -143,8 +142,8 @@ async def list_service_releases(
releases.append(ServiceMetaDataAtDB.from_orm(row))

# Now sort naturally from latest first: (This is lame, the sorting should be done in the db)
def _by_version(x: ServiceMetaDataAtDB) -> Version:
return cast(Version, packaging.version.parse(x.version))
def _by_version(x: ServiceMetaDataAtDB) -> packaging.version.Version:
return cast(packaging.version.Version, packaging.version.parse(x.version))

releases_sorted = sorted(releases, key=_by_version, reverse=True)
return releases_sorted
Expand Down Expand Up @@ -269,7 +268,7 @@ async def get_service_access_rights(

async with self.db_engine.connect() as conn:
async for row in await conn.stream(query):
services_in_db.append(ServiceAccessRightsAtDB(**row))
services_in_db.append(ServiceAccessRightsAtDB.from_orm(row))
return services_in_db

async def list_services_access_rights(
Expand Down Expand Up @@ -298,7 +297,7 @@ async def list_services_access_rights(
row[services_access_rights.c.key],
row[services_access_rights.c.version],
)
].append(ServiceAccessRightsAtDB(**row))
].append(ServiceAccessRightsAtDB.from_orm(row))
return service_to_access_rights

async def upsert_service_access_rights(
Expand Down

0 comments on commit dec7db6

Please sign in to comment.