Skip to content

Commit

Permalink
squashme: minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Feb 6, 2025
1 parent c4608a3 commit bd1b306
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions components/renku_data_services/data_connectors/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from cryptography.hazmat.primitives.asymmetric import rsa
from sqlalchemy import Select, delete, func, select
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import joinedload, selectinload
from sqlalchemy.orm import joinedload
from ulid import ULID

from renku_data_services import base_models, errors
Expand Down Expand Up @@ -657,12 +657,21 @@ async def get_data_connectors_with_secrets(
)

async with self.session_maker() as session:
stmt = select(schemas.DataConnectorORM).where(
schemas.DataConnectorORM.project_links.any(
schemas.DataConnectorToProjectLinkORM.project_id == project_id
),
schemas.DataConnectorORM.id.in_(data_connector_ids),
stmt = (
select(schemas.DataConnectorORM)
.where(
schemas.DataConnectorORM.project_links.any(
schemas.DataConnectorToProjectLinkORM.project_id == project_id
),
schemas.DataConnectorORM.id.in_(data_connector_ids),
)
.options(
joinedload(schemas.DataConnectorORM.slug)
.joinedload(ns_schemas.EntitySlugORM.project)
.selectinload(ProjectORM.slug)
)
)

results = await session.stream_scalars(stmt)
async for dc in results:
secrets = await self.get_data_connector_secrets(user, dc.id)
Expand Down

0 comments on commit bd1b306

Please sign in to comment.