Skip to content

refactor: pass db.session explicitly in sync_account_deletion (#37403)#38130

Open
EvanYao826 wants to merge 2 commits into
langgenius:mainfrom
EvanYao826:refactor/account-deletion-sync-session-param
Open

refactor: pass db.session explicitly in sync_account_deletion (#37403)#38130
EvanYao826 wants to merge 2 commits into
langgenius:mainfrom
EvanYao826:refactor/account-deletion-sync-session-param

Conversation

@EvanYao826

Copy link
Copy Markdown
Contributor

Summary

Make session dependency explicit in sync_account_deletion enterprise function, following the pattern from PR #37402.

Changes

api/services/enterprise/account_deletion_sync.py

  • sync_account_deletion(account_id, *, source, session) — replaces internal db.session with explicit parameter
  • Remove from extensions.ext_database import db import (no longer needed)
  • Add from sqlalchemy.orm import scoped_session import

Callers updated:

  • api/services/account_service.py — pass db.session to sync_account_deletion

Related

Closes #37403 (partial)

Checklist

  • Tests pass
  • Lint clean (ruff)
  • Single atomic change

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. refactor labels Jun 29, 2026
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-06-29 02:20:24.474712784 +0000
+++ /tmp/pyrefly_pr.txt	2026-06-29 02:20:09.955554626 +0000
@@ -776,6 +776,16 @@
   --> tests/test_containers_integration_tests/repositories/test_workflow_run_repository.py:89:56
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/test_containers_integration_tests/services/auth/test_api_key_auth_service.py:196:16
+ERROR Missing argument `session` in function `services.enterprise.account_deletion_sync.sync_account_deletion` [missing-argument]
+   --> tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py:121:43
+ERROR Missing argument `session` in function `services.enterprise.account_deletion_sync.sync_account_deletion` [missing-argument]
+   --> tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py:140:43
+ERROR Missing argument `session` in function `services.enterprise.account_deletion_sync.sync_account_deletion` [missing-argument]
+   --> tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py:154:43
+ERROR Missing argument `session` in function `services.enterprise.account_deletion_sync.sync_account_deletion` [missing-argument]
+   --> tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py:179:43
+ERROR Missing argument `session` in function `services.enterprise.account_deletion_sync.sync_account_deletion` [missing-argument]
+   --> tests/test_containers_integration_tests/services/enterprise/test_account_deletion_sync.py:199:43
 ERROR Could not find name `Session` [unknown-name]
   --> tests/test_containers_integration_tests/services/plugin/test_plugin_parameter_service.py:54:37
 ERROR Could not find name `Session` [unknown-name]

@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 51.48% 51.48% +0.00%
Strict coverage 51.00% 51.00% +0.00%
Typed symbols 30,824 30,825 +1
Untyped symbols 29,325 29,325 0
Modules 2931 2931 0

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make db.session pass from parameter.

1 participant