chore: DocumentSegment to Typebase#35635
Merged
asukaminato0721 merged 22 commits intoMay 12, 2026
Merged
Conversation
b0a44dd to
6e36ec7
Compare
Contributor
Pyrefly Type Coverage
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-05-12 06:26:21.175751462 +0000
+++ /tmp/pyrefly_pr.txt 2026-05-12 06:26:13.024860963 +0000
@@ -1043,10 +1043,6 @@
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_dataset_service_delete_dataset.py:32:20
ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_dataset_service_get_segments.py:38:20
-ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_dataset_service_get_segments.py:44:62
-ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:38:20
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_dataset_service_permissions.py:40:58
@@ -1506,10 +1502,6 @@
--> tests/test_containers_integration_tests/tasks/test_batch_clean_document_task.py:73:20
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/tasks/test_batch_clean_document_task.py:82:20
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_batch_clean_document_task.py:297:23
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_batch_clean_document_task.py:698:27
ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/tasks/test_batch_create_segment_to_index_task.py:101:20
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
@@ -1523,131 +1515,111 @@
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:123:20
ERROR Argument `IndexTechniqueType | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:298:32
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:295:32
ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:301:22
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:298:22
ERROR Argument `IndexTechniqueType | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:422:32
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:419:32
ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:425:22
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:422:22
ERROR Argument `IndexTechniqueType | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:498:36
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:495:36
ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:501:26
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:498:26
ERROR Argument `IndexTechniqueType | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:555:32
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:552:32
ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:558:22
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:555:22
ERROR Argument `IndexTechniqueType | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:644:36
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:638:36
ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:647:26
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:641:26
ERROR Argument `IndexTechniqueType | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:761:32
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:751:32
ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:764:22
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:754:22
ERROR Argument `IndexTechniqueType | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:855:32
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:845:32
ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:858:22
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:848:22
ERROR Argument `IndexTechniqueType | None` is not assignable to parameter `indexing_technique` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:1012:32
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:999:32
ERROR Argument `str | None` is not assignable to parameter `doc_form` with type `str` in function `celery.app.task.Task.__call__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:1015:22
+ --> tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py:1002:22
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:100:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:117:27
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:140:31
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:222:23
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:271:27
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:283:27
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:304:27
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:354:23
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:366:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:221:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:388:27
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:270:27
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:437:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:282:27
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:454:27
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:352:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:476:31
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:364:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:539:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:434:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:551:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:451:27
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:576:27
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:535:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:640:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:547:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:652:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:635:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:672:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:647:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:733:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:727:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:751:27
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:774:31
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:745:27
ERROR `num_segments_per_doc` may be uninitialized [unbound-name]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:795:32
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:788:32
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:839:27
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:832:27
ERROR `>=` is not supported between `None` and `Literal[3]` [unsupported-operation]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:898:16
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:890:16
ERROR `>=` is not supported between `None` and `Literal[9]` [unsupported-operation]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:899:16
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:944:23
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:970:27
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:891:16
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:992:31
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:936:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:1050:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:962:27
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:1063:23
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:1041:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:1100:27
+ --> tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py:1054:23
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:229:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:226:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:332:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:327:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:443:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:436:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:578:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:568:16
ERROR Object of class `NoneType` has no attribute `error` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:579:52
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:569:52
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:651:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:639:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:729:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:715:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:835:20
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:922:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:939:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1032:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1051:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1038:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1057:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1153:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1174:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1159:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1180:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1274:16
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1297:16
-ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1303:16
+ --> tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py:1280:16
ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/tasks/test_disable_segment_from_index_task.py:56:20
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
@@ -1711,55 +1683,55 @@
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:93:20
ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:225:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:224:20
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:232:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:231:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:327:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:326:20
ERROR Object of class `NoneType` has no attribute `processing_started_at` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:328:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:327:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:379:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:378:20
ERROR Object of class `NoneType` has no attribute `processing_started_at` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:380:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:379:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:448:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:447:20
ERROR Object of class `NoneType` has no attribute `processing_started_at` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:449:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:448:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:495:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:494:20
ERROR Object of class `NoneType` has no attribute `processing_started_at` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:496:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:495:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:553:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:552:20
ERROR Object of class `NoneType` has no attribute `error` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:554:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:553:20
ERROR Object of class `object` has no attribute `lower` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:555:38
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:554:38
ERROR Object of class `NoneType` has no attribute `stopped_at` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:556:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:555:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:595:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:594:20
ERROR Object of class `NoneType` has no attribute `error` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:596:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:595:20
ERROR Object of class `object` has no attribute `lower` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:597:31
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:596:31
ERROR Object of class `NoneType` has no attribute `stopped_at` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:598:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:597:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:659:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:658:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:702:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:701:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:746:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:745:20
ERROR Object of class `NoneType` has no attribute `is_paused` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:861:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:860:20
ERROR Object of class `NoneType` has no attribute `indexing_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:862:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:861:20
ERROR Object of class `NoneType` has no attribute `display_status` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:863:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:862:20
ERROR Object of class `NoneType` has no attribute `processing_started_at` [missing-attribute]
- --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:864:20
+ --> tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py:863:20
ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/tasks/test_enable_segments_to_index_task.py:55:20
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
@@ -6043,18 +6015,6 @@
--> tests/unit_tests/services/test_dataset_service_segment.py:182:80
ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.SegmentService.delete_child_chunk` [bad-argument-type]
--> tests/unit_tests/services/test_dataset_service_segment.py:205:64
-ERROR Argument `list[Unknown] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- --> tests/unit_tests/services/test_dataset_service_segment.py:465:20
-ERROR Type `None` is not iterable [not-iterable]
- --> tests/unit_tests/services/test_dataset_service_segment.py:466:49
-ERROR Type `None` is not iterable [not-iterable]
- --> tests/unit_tests/services/test_dataset_service_segment.py:467:47
-ERROR Type `None` is not iterable [not-iterable]
- --> tests/unit_tests/services/test_dataset_service_segment.py:468:61
-ERROR Type `None` is not iterable [not-iterable]
- --> tests/unit_tests/services/test_dataset_service_segment.py:469:60
-ERROR Type `None` is not iterable [not-iterable]
- --> tests/unit_tests/services/test_dataset_service_segment.py:470:68
ERROR Argument `SimpleNamespace` is not assignable to parameter `segment` with type `DocumentSegment` in function `services.dataset_service.SegmentService.update_child_chunk` [bad-argument-type]
--> tests/unit_tests/services/test_dataset_service_segment.py:811:49
ERROR Argument `SimpleNamespace` is not assignable to parameter `document` with type `Document` in function `services.dataset_service.SegmentService.update_child_chunk` [bad-argument-type]
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the DocumentSegment ORM model to TypeBase (SQLAlchemy MappedAsDataclass) and updates tasks/tests to accommodate the new typed/dataclass initialization patterns, including safer handling of nullable index_node_id when cleaning vector indexes.
Changes:
- Convert
DocumentSegmenttoTypeBaseand retype key columns (includingstatusasSegmentStatus). - Update indexing/cleanup tasks to ignore
Noneindex_node_idvalues when buildingindex_node_ids. - Adjust unit/integration tests to stop passing
id=duringDocumentSegmentconstruction and switch status strings to enums in several places.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| api/tests/unit_tests/services/test_dataset_service_segment.py | Updates unit tests to work with DocumentSegment dataclass-style init (no id= in ctor). |
| api/tests/test_containers_integration_tests/tasks/test_enable_segments_to_index_task.py | Removes explicit id= in segment factory to align with new model defaults. |
| api/tests/test_containers_integration_tests/tasks/test_duplicate_document_indexing_task.py | Removes explicit id= for segments created in integration tests. |
| api/tests/test_containers_integration_tests/tasks/test_disable_segments_from_index_task.py | Refactors segment creation to constructor-based init; minor type-related adjustments. |
| api/tests/test_containers_integration_tests/tasks/test_disable_segment_from_index_task.py | Changes helper signature to use SegmentStatus enum instead of string. |
| api/tests/test_containers_integration_tests/tasks/test_delete_segment_from_index_task.py | Removes explicit id= during segment creation; adjusts test data setup. |
| api/tests/test_containers_integration_tests/tasks/test_deal_dataset_vector_index_task.py | Removes explicit id= from Dataset/DocumentSegment constructors where defaults exist. |
| api/tests/test_containers_integration_tests/tasks/test_clean_notion_document_task.py | Removes explicit id= on segments and adds some assertions in test setup. |
| api/tests/test_containers_integration_tests/tasks/test_clean_dataset_task.py | Removes explicit id= on segments; test setup adjusted for new model init. |
| api/tests/test_containers_integration_tests/tasks/test_batch_clean_document_task.py | Removes explicit id= on segments and adds tenant assertions for setup typing. |
| api/tests/test_containers_integration_tests/tasks/test_add_document_to_index_task.py | Removes explicit id= on segments created in integration tests. |
| api/tests/test_containers_integration_tests/services/test_dataset_service_get_segments.py | Switches various status fields from strings to enums; expands imports accordingly. |
| api/tasks/sync_website_document_indexing_task.py | Filters out None index_node_id values before cleaning index. |
| api/tasks/duplicate_document_indexing_task.py | Filters out None index_node_id values before cleaning index. |
| api/tasks/document_indexing_sync_task.py | Filters out None index_node_id values before cleaning index. |
| api/tasks/disable_segments_from_index_task.py | Filters out None index_node_id values before cleaning index. |
| api/tasks/clean_document_task.py | Filters out None index_node_id values before cleaning index. |
| api/tasks/batch_create_segment_to_index_task.py | Uses SegmentStatus.COMPLETED instead of "completed" string for new segments. |
| api/tasks/batch_clean_document_task.py | Filters out None index_node_id values before cleaning index. |
| api/services/vector_service.py | Adds assertions around segment.index_node_id before vector/keyword operations and child chunk generation. |
| api/models/dataset.py | Converts DocumentSegment to TypeBase and redefines columns with dataclass-friendly typing/defaults. |
| api/core/rag/index_processor/index_processor.py | Filters out None index_node_id values before cleaning index. |
| api/core/rag/docstore/dataset_docstore.py | Adds an assertion for _document_id prior to creating DocumentSegment. |
| api/core/rag/datasource/retrieval_service.py | Tweaks typing around index_node_segments and adds assertions; imports Sequence. |
| api/core/rag/datasource/keyword/jieba/jieba.py | Adds assertions ensuring segment.index_node_id exists before keyword table updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WH-2099
approved these changes
May 12, 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.
Important
Fixes #<issue number>.Summary
Screenshots
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods