Skip to content

test: migrate core service residuals sessions and ORM models to SQLite - #40547

Open
asukaminato0721 wants to merge 1 commit into
langgenius:mainfrom
asukaminato0721:agent/sqlite-orm-core-service-residuals
Open

test: migrate core service residuals sessions and ORM models to SQLite#40547
asukaminato0721 wants to merge 1 commit into
langgenius:mainfrom
asukaminato0721:agent/sqlite-orm-core-service-residuals

Conversation

@asukaminato0721

Copy link
Copy Markdown
Contributor

Summary

  • migrate residual advanced-chat pipeline, MCP auth, Ops tracing, indexing, Celery repository, app DSL, workflow draft-variable, restore, and Agent retirement tests to shared SQLite-backed SQLAlchemy sessions
  • replace Message, MessageAgentThought, App, Account, Workflow, UploadFile, HumanInputContent, Dataset, and Document stand-ins with real mapped instances
  • exercise committed persistence, duplicate detection, scoped-session behavior, and transaction failures through real SQLAlchemy execution
  • remove obsolete shared helpers that fabricated db.session execute chains

Persistence coverage

  • observes HumanInputContent and WorkflowDraftVariableFile writes through SQLite sessions
  • uses a real scoped_session for Ops trace model properties and relationships
  • injects real Session objects into MCP auth and raises a database failure through a SQLAlchemy engine event
  • uses the repository-wide sqlite_session_factory for Celery repositories
  • seeds real model ownership and mapped entities for app DSL, workflow restoration, indexing uploads, and Agent retirement

Production changes

None.

Size

375 additions + 439 deletions = 814 changed lines.

Validation

  • make test TARGET_TESTS="./api/tests/unit_tests/conftest.py ... 11 targeted modules": 171 passed
  • direct final targeted run: 171 passed, 1 warning
  • make lint: passed
  • make type-check: pyrefly passed branch-local checks; mypy 1.20.2 hit its existing internal error at api/.venv/lib/python3.12/site-packages/mypy/typeshed/stdlib/zipimport.pyi:17
  • structural/text audit: no mocked SQLAlchemy Session/sessionmaker/scoped_session or mapped-model stand-ins remain in the changed modules; MCP session mocks are external MCP ClientSession objects
  • full test suite not run per request

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-08-12 02:35:40.525863520 +0000
+++ /tmp/pyrefly_pr.txt	2026-08-12 02:35:32.331801791 +0000
@@ -3163,17 +3163,17 @@
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_response_converter.py:131:16
 ERROR `SimpleNamespace` is not assignable to attribute `_application_generate_entity` with type `AdvancedChatAppGenerateEntity` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:109:45
+  --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:92:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AdvancedChatAppGenerateEntity` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:176:37
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:154:37
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:178:23
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:156:23
 ERROR Argument `SimpleNamespace` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:184:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:162:33
 ERROR `SimpleNamespace` is not assignable to attribute `_application_generate_entity` with type `AdvancedChatAppGenerateEntity` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:218:45
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:178:45
 ERROR `SimpleNamespace` is not assignable to attribute `_application_generate_entity` with type `AdvancedChatAppGenerateEntity` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:240:45
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:200:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:104:23
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3230,8 +3230,6 @@
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:490:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline[Unknown], e: Exception) -> ErrorStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:495:65
-ERROR `(**kwargs: Session) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:496:33
 ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:521:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
@@ -3245,21 +3243,21 @@
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:583:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:618:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:614:78
 ERROR `(**kwargs: QueueHumanInputFormFilledEvent | str) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:631:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:627:92
 ERROR `(**kwargs: QueueHumanInputFormTimeoutEvent | str) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:632:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:628:93
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:689:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:685:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline[Unknown], completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:710:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:706:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:711:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:707:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:712:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:708:52
 ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:728:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:724:89
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model_config` with type `AppModelConfig | None` in function `core.app.apps.agent_app.app_config_manager.AgentAppConfigManager._synthesize_config_dict` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_app/test_app_config_manager.py:57:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model_config` with type `AppModelConfig | None` in function `core.app.apps.agent_app.app_config_manager.AgentAppConfigManager._synthesize_config_dict` [bad-argument-type]
@@ -4625,59 +4623,59 @@
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:23:9
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:356:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:342:12
 ERROR Argument `AppModelConfig | Any | None` is not assignable to parameter `s` with type `bytearray | bytes | str` in function `json.loads` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:362:23
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:348:23
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:406:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:390:12
 ERROR Object of class `dict` has no attribute `conversation_mode` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:407:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:391:12
 ERROR Object of class `dict` has no attribute `file_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:408:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:392:12
 ERROR Object of class `dict` has no attribute `metadata` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:409:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:393:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:436:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:425:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:437:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:426:12
 ERROR Object of class `dict` has no attribute `inputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:438:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:427:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:440:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:429:12
 ERROR Object of class `dict` has no attribute `suggested_question` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:441:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:430:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:447:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:460:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:448:12
 ERROR Object of class `dict` has no attribute `metadata` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:461:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:449:12
 ERROR Cannot instantiate `DifyAPISQLAlchemyWorkflowRunRepository` because the following members are abstract: `save` [bad-instantiation]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:503:50
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:491:50
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:497:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
 ERROR Object of class `dict` has no attribute `workflow_app_log_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:511:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
 ERROR Object of class `dict` has no attribute `prompt_tokens` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:512:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:500:12
 ERROR Object of class `dict` has no attribute `completion_tokens` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:513:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:501:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:536:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:528:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:537:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:529:12
 ERROR Object of class `dict` has no attribute `message_file_data` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:538:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:530:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:560:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:552:12
 ERROR Object of class `dict` has no attribute `metadata` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:561:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:553:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:579:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:571:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:580:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:572:12
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
 ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
@@ -5107,35 +5105,35 @@
 ERROR Argument `None` is not assignable to parameter `text` with type `str` in function `core.rag.splitter.text_splitter.RecursiveCharacterTextSplitter.split_text` [bad-argument-type]
     --> tests/unit_tests/core/rag/splitter/test_text_splitter.py:1893:42
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-  --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:84:53
+  --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:73:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:100:53
+  --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:89:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:113:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:102:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:130:50
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:119:50
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:142:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:131:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:158:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:147:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:192:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:181:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:213:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:202:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:229:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:218:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:252:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:241:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:268:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:257:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:290:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:279:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:322:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:311:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:344:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:333:53
 ERROR Cannot instantiate `CeleryWorkflowNodeExecutionRepository` because the following members are abstract: `save_execution_data` [bad-instantiation]
-   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:396:53
+   --> tests/unit_tests/core/repositories/test_celery_workflow_node_execution_repository.py:385:53
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
   --> tests/unit_tests/core/repositories/test_human_input_repository.py:56:56
 ERROR Argument `Literal['invalid']` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository.__init__` [bad-argument-type]
@@ -7508,6 +7506,8 @@
   --> tests/unit_tests/services/test_api_token_service.py:29:9
 ERROR Argument `Literal['app']` is not assignable to parameter `value` with type `ApiTokenType | SQLCoreOperations[ApiTokenType]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
   --> tests/unit_tests/services/test_api_token_service.py:44:26
+ERROR Could not find name `SimpleNamespace` [unknown-name]
+   --> tests/unit_tests/services/test_app_dsl_service.py:417:21
 ERROR Class member `_TrackingRateLimit.exit` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/services/test_app_generate_service.py:574:17
 ERROR Class member `_TrackingRateLimit.exit` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
@@ -8251,11 +8251,11 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.workflow.workflow_converter.WorkflowConverter._get_api_based_extension` [bad-argument-type]
    --> tests/unit_tests/services/workflow/test_workflow_converter_additional.py:865:71
 ERROR Object of class `Account` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/workflow/test_workflow_draft_variable_service.py:272:9
+   --> tests/unit_tests/services/workflow/test_workflow_draft_variable_service.py:290:9
 ERROR Object of class `Account` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/services/workflow/test_workflow_draft_variable_service.py:307:9
+   --> tests/unit_tests/services/workflow/test_workflow_draft_variable_service.py:325:9
 ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[bool] | bool` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/unit_tests/services/workflow/test_workflow_draft_variable_service.py:687:37
+   --> tests/unit_tests/services/workflow/test_workflow_draft_variable_service.py:705:37
 ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[datetime] | datetime` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> tests/unit_tests/services/workflow/test_workflow_event_snapshot_service.py:506:30
 ERROR Class member `_PauseEntity.id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
@@ -8272,8 +8272,6 @@
    --> tests/unit_tests/services/workflow/test_workflow_event_snapshot_service_additional.py:175:9
 ERROR Argument `dict[str, list[Unknown] | str | dict[str, bool] | dict[str, bool | str] | dict[str, dict[str, bool | int | list[str]]]]` is not assignable to parameter `features` with type `dict[str, object]` in function `_create_workflow` [bad-argument-type]
   --> tests/unit_tests/services/workflow/test_workflow_restore.py:62:18
-ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.workflow_restore.apply_published_workflow_snapshot_to_draft` [bad-argument-type]
-  --> tests/unit_tests/services/workflow/test_workflow_restore.py:70:17
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
   --> tests/unit_tests/tasks/test_clean_dataset_task.py:91:56
 ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]

@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 58.89% 58.89% +0.01%
Strict coverage 58.46% 58.47% +0.01%
Typed symbols 38,938 38,940 +2
Untyped symbols 27,383 27,374 -9
Modules 3144 3144 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant