Skip to content

chore: batch example #38419#38474

Merged
asukaminato0721 merged 5 commits into
langgenius:mainfrom
asukaminato0721:38419
Jul 9, 2026
Merged

chore: batch example #38419#38474
asukaminato0721 merged 5 commits into
langgenius:mainfrom
asukaminato0721:38419

Conversation

@asukaminato0721

Copy link
Copy Markdown
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

#38419

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 6, 2026
@asukaminato0721 asukaminato0721 requested a review from Copilot July 6, 2026 10:11
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 52.58% 52.58% -0.00%
Strict coverage 52.09% 52.09% -0.00%
Typed symbols 32,521 32,520 -1
Untyped symbols 29,605 29,605 0
Modules 2981 2981 0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the backend summary indexing service to disable DocumentSegmentSummary rows using a bulk SQLAlchemy UPDATE, aligning with the linked issue’s goal of improving ORM update performance for batch operations.

Changes:

  • Replaces per-row ORM attribute updates with a single bulk UPDATE statement when disabling summaries.
  • Adds the SQLAlchemy update import to support the new bulk operation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/services/summary_index_service.py Outdated
Comment thread api/services/summary_index_service.py
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-07-08 15:24:09.372046527 +0000
+++ /tmp/pyrefly_pr.txt	2026-07-08 15:24:00.154981076 +0000
@@ -8085,19 +8085,25 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.increment_use_count` [bad-argument-type]
    --> tests/unit_tests/services/test_snippet_service.py:678:65
 ERROR Missing required key `enable` for TypedDict `SummaryIndexSettingDict` [bad-typed-dict-key]
-  --> tests/unit_tests/services/test_summary_index_service.py:98:93
+   --> tests/unit_tests/services/test_summary_index_service.py:101:93
 ERROR Key `a` is not defined in TypedDict `SummaryIndexSettingDict` [bad-typed-dict-key]
-  --> tests/unit_tests/services/test_summary_index_service.py:98:94
+   --> tests/unit_tests/services/test_summary_index_service.py:101:94
 ERROR Missing required key `enable` for TypedDict `SummaryIndexSettingDict` [bad-typed-dict-key]
-   --> tests/unit_tests/services/test_summary_index_service.py:118:82
+   --> tests/unit_tests/services/test_summary_index_service.py:121:82
 ERROR Key `a` is not defined in TypedDict `SummaryIndexSettingDict` [bad-typed-dict-key]
-   --> tests/unit_tests/services/test_summary_index_service.py:118:83
+   --> tests/unit_tests/services/test_summary_index_service.py:121:83
+ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
+   --> tests/unit_tests/services/test_summary_index_service.py:662:5
+ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
+   --> tests/unit_tests/services/test_summary_index_service.py:686:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.summary_index_service.SummaryIndexService.disable_summaries_for_segments` [bad-argument-type]
+   --> tests/unit_tests/services/test_summary_index_service.py:691:56
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
-    --> tests/unit_tests/services/test_summary_index_service.py:1024:12
+    --> tests/unit_tests/services/test_summary_index_service.py:1043:12
 ERROR Object of class `NoneType` has no attribute `error` [missing-attribute]
-    --> tests/unit_tests/services/test_summary_index_service.py:1025:39
+    --> tests/unit_tests/services/test_summary_index_service.py:1044:39
 ERROR Object of class `NoneType` has no attribute `endswith` [missing-attribute]
-    --> tests/unit_tests/services/test_summary_index_service.py:1086:12
+    --> tests/unit_tests/services/test_summary_index_service.py:1105:12
 ERROR Cannot set item in `dict[str, int]` [unsupported-operation]
    --> tests/unit_tests/services/test_variable_truncator.py:142:31
 ERROR Argument `dict[str, dict[Unknown, Unknown]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]

wylswz
wylswz previously approved these changes Jul 8, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 8, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue Jul 9, 2026
Merged via the queue into langgenius:main with commit 4595722 Jul 9, 2026
31 checks passed
@asukaminato0721 asukaminato0721 deleted the 38419 branch July 9, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants