Skip to content

Bug: delete_where fails if load is provided for service/repository #287

Closed

Description

@noamsto

Description

If load is provided for a service/repo delete_where will fail.

async def provide_document_access_received_service(
    request: "Request[UserAccount, Token, Any]", db_session: AsyncSession
) -> AsyncGenerator[ResourceAccessService, None]:
    """Provider for resource access service."""
    async with ResourceAccessService.new(
        statement=select(ResourceAccess)
        .where(ResourceAccess.recipient_tenant_id.in_(request.user.accessible_tenant_ids))
        .filter(ResourceAccess.resource.has(Resource.resource_type == ResourceType.DOCUMENT)),
        load=selectin_polymorphic(Resource, [Document]),
        session=db_session,
    ) as service:
        yield service

URL to code causing the issue

No response

MCVE

No response

Steps to reproduce

No response

Screenshots

Screenshot_20241112_135600

Logs

No response

Package Version

v0.23.1

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Activity

  1. added
    lambda-stmtRelated to `lambda_stmt` in SQLAlchemy. Not necessarily an `advanced-alchemy` bug.
    on Nov 14, 2024
  2. linked a pull request that will close this issuefeat: remove lambda statement usage #288on Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglambda-stmtRelated to `lambda_stmt` in SQLAlchemy. Not necessarily an `advanced-alchemy` bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions