refactor: pass db session into service calls (#37403)#38016
Merged
asukaminato0721 merged 3 commits intoJun 26, 2026
Merged
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-06-26 07:40:13.108983518 +0000
+++ /tmp/pyrefly_pr.txt 2026-06-26 07:39:58.091890135 +0000
@@ -6873,29 +6873,29 @@
ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | EndUser` in function `services.async_workflow_service.AsyncWorkflowService.reinvoke_trigger` [bad-argument-type]
--> tests/unit_tests/services/test_async_workflow_service.py:322:22
ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
- --> tests/unit_tests/services/test_billing_service.py:1853:41
+ --> tests/unit_tests/services/test_billing_service.py:1856:41
ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
- --> tests/unit_tests/services/test_billing_service.py:1862:41
+ --> tests/unit_tests/services/test_billing_service.py:1865:41
ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
- --> tests/unit_tests/services/test_billing_service.py:1875:41
+ --> tests/unit_tests/services/test_billing_service.py:1878:41
ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
- --> tests/unit_tests/services/test_billing_service.py:1886:41
+ --> tests/unit_tests/services/test_billing_service.py:1889:41
ERROR Argument `FakeRepo` is not assignable to parameter `workflow_run_repo` with type `APIWorkflowRunRepository | None` in function `services.retention.workflow_run.clear_free_plan_expired_workflow_run_logs.WorkflowRunCleanup.__init__` [bad-argument-type]
--> tests/unit_tests/services/test_clear_free_plan_expired_workflow_run_logs.py:126:49
ERROR Class member `FailingRepo.delete_runs_with_related_by_ids` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
--> tests/unit_tests/services/test_clear_free_plan_expired_workflow_run_logs.py:394:13
ERROR Class member `FixedDateTime.now` overrides parent class `datetime` in an inconsistent manner [bad-override]
- --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:405:13
+ --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:401:13
ERROR Class member `FixedDateTime.now` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:405:13
+ --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:401:13
ERROR Class member `FixedDateTime.now` overrides parent class `datetime` in an inconsistent manner [bad-override]
- --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:480:13
+ --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:483:13
ERROR Class member `FixedDateTime.now` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:480:13
+ --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:483:13
ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account` in function `services.credential_permission_service.CredentialPermissionService.apply_visibility_filter` [bad-argument-type]
- --> tests/unit_tests/services/test_credential_permission_service.py:80:18
+ --> tests/unit_tests/services/test_credential_permission_service.py:82:18
ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account` in function `services.credential_permission_service.CredentialPermissionService.apply_visibility_filter` [bad-argument-type]
- --> tests/unit_tests/services/test_credential_permission_service.py:97:18
+ --> tests/unit_tests/services/test_credential_permission_service.py:99:18
ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
--> tests/unit_tests/services/test_credit_pool_service.py:24:5
ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
|
Contributor
Pyrefly Type Coverage
|
asukaminato0721
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pass explicit database sessions into selected service calls.
Refs #37403
Changes
Why
Passing the database session explicitly keeps related operations within the intended transaction/session boundary and makes service dependencies clearer in tests and call sites.
Screenshots
N/A, backend refactor only.
Checklist