From fa450fa7271249b775100b85e131c1a1ab86f174 Mon Sep 17 00:00:00 2001 From: Boris Arzentar Date: Thu, 13 Nov 2025 14:04:05 +0100 Subject: [PATCH] fix: remove unused set_current_user and add missing delete test to e2e_tests --- .github/workflows/e2e_tests.yml | 31 +++++++++++++++++++ .../modules/graph/methods/set_current_user.py | 8 ----- 2 files changed, 31 insertions(+), 8 deletions(-) delete mode 100644 cognee/modules/graph/methods/set_current_user.py diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 415ec9b50..16da929e1 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -325,6 +325,37 @@ jobs: EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} run: uv run python ./cognee/tests/test_delete_default_graph.py + test-deletion-on-default-graph-non-mocked: + name: Delete default graph data test ${{ matrix.python-version }} on ubuntu-22.04 + runs-on: ubuntu-22.04 + strategy: + matrix: + python-version: ${{ fromJSON(inputs.supported-python-versions) }} + fail-fast: false + steps: + - name: Check out + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cognee Setup + uses: ./.github/actions/cognee_setup + with: + python-version: ${{ matrix.python-version }} + + - name: Run deletion on default graph non mocked + env: + ENV: 'dev' + LLM_MODEL: ${{ secrets.LLM_MODEL }} + LLM_ENDPOINT: ${{ secrets.LLM_ENDPOINT }} + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_API_VERSION: ${{ secrets.LLM_API_VERSION }} + EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }} + EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} + EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} + EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} + run: uv run python ./cognee/tests/test_delete_default_graph_non_mocked.py + test-deletion-on-custom-graph: name: Delete custom graph data test ${{ matrix.python-version }} on ubuntu-22.04 runs-on: ubuntu-22.04 diff --git a/cognee/modules/graph/methods/set_current_user.py b/cognee/modules/graph/methods/set_current_user.py deleted file mode 100644 index 49d471f0e..000000000 --- a/cognee/modules/graph/methods/set_current_user.py +++ /dev/null @@ -1,8 +0,0 @@ -import uuid -from sqlalchemy import text -from sqlalchemy.ext.asyncio import AsyncSession - - -async def set_current_user(session: AsyncSession, user_id: uuid.UUID, local: bool = False): - scope = "LOCAL " if local else "" - await session.execute(text(f"SET {scope}app.current_user_id = '{user_id}'"))