Repository navigation
fix: fix list dataset not include own - #44795
Merged
Merged
Conversation
Contributor
Pyrefly Type Coverage
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #44795 +/- ##
===========================================
+ Coverage 68.30% 89.41% +21.10%
===========================================
Files 5832 5988 +156
Lines 347015 375593 +28578
Branches 74185 76152 +1967
===========================================
+ Hits 237045 335831 +98786
+ Misses 107718 33709 -74009
- Partials 2252 6053 +3801
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wylswz
reviewed
Oct 26, 2026
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-10-26 07:56:14.622673325 +0000
+++ /tmp/pyrefly_pr.txt 2026-10-26 07:56:04.502628897 +0000
@@ -5781,41 +5781,41 @@
ERROR `None` is not subscriptable [unsupported-operation]
--> tests/unit_tests/services/knowledge/metadata/test_application.py:434:20
ERROR Object of class `NoneType` has no attribute `keyword_number` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:1440:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1438:20
ERROR Argument `str` is not assignable to parameter `data_source_type` with type `DataSourceType | SQLCoreOperations[DataSourceType]` in function `models.dataset.Document.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:1755:26
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1753:26
ERROR Argument `str` is not assignable to parameter `indexing_status` with type `IndexingStatus | SQLCoreOperations[IndexingStatus]` in function `models.dataset.Document.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:1761:25
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1759:25
ERROR Argument `Literal['opendal']` is not assignable to parameter `storage_type` with type `StorageType` in function `tests.helpers.unit.model_factories.make_upload_file` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:1778:22
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1776:22
ERROR Argument `str` is not assignable to parameter `mode` with type `ProcessRuleMode | SQLCoreOperations[ProcessRuleMode]` in function `models.dataset.DatasetProcessRule.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:1799:37
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1797:37
ERROR Argument `Literal['opendal']` is not assignable to parameter `storage_type` with type `StorageType` in function `models.model.UploadFile.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2039:30
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2037:30
ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole` in function `models.model.UploadFile.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2045:33
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2043:33
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2070:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2068:20
ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2071:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2069:20
ERROR Argument `Literal['opendal']` is not assignable to parameter `storage_type` with type `StorageType` in function `models.model.UploadFile.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2513:30
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2511:30
ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole` in function `models.model.UploadFile.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2519:33
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2517:33
ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2598:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2596:20
ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2697:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2695:20
ERROR Argument `list[PreProcessingRule] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2801:24
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2799:24
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2802:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2800:20
ERROR Object of class `NoneType` has no attribute `rules` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:3802:42
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:3800:42
ERROR Argument `Literal['completed']` is not assignable to parameter `indexing_status` with type `IndexingStatus | SQLCoreOperations[IndexingStatus]` in function `models.dataset.Document.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:4237:25
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:4235:25
ERROR Argument `str` is not assignable to parameter `doc_form` with type `IndexStructureType | SQLCoreOperations[IndexStructureType]` in function `models.dataset.Document.__init__` [bad-argument-type]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:4238:18
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:4236:18
ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
--> tests/unit_tests/services/plugin/test_plugin_parameter_service.py:47:9
ERROR Class member `DummyRetrieval.get_pipeline_templates` overrides parent class `PipelineTemplateRetrievalBase` in an inconsistent manner [bad-override]
|
wylswz
approved these changes
Oct 26, 2026
2 tasks
xhdnoah
added a commit
to xhdnoah/dify
that referenced
this pull request
Oct 28, 2026
Remove the include_own_datasets parameter and the conditional gate so that maintainers always retain visibility of their own datasets when RBAC is enabled, matching the main branch behavior. The LTS branch predates the dataset application boundary refactor (langgenius#41729, 2026-09-29) that introduced api/services/knowledge/datasets/. The same logic is applied to the pre-refactor files instead. Source commits on main: - 4c830e8 (fix: fix list dataset not include own) - e1278ec (chore: remove include_own_datasets param)
xhdnoah
added a commit
to xhdnoah/dify
that referenced
this pull request
Oct 28, 2026
Remove the include_own_datasets parameter and the conditional gate so that maintainers always retain visibility of their own datasets when RBAC is enabled, matching the main branch behavior. The LTS branch predates the dataset application boundary refactor (langgenius#41729, 2026-09-29) that introduced api/services/knowledge/datasets/. The same logic is applied to the pre-refactor files instead. (cherry picked from commit a394d04)
xhdnoah
added a commit
to xhdnoah/dify
that referenced
this pull request
Oct 28, 2026
Remove the include_own_datasets parameter and the conditional gate so that maintainers always retain visibility of their own datasets when RBAC is enabled, matching the main branch behavior. The LTS branch predates the dataset application boundary refactor (langgenius#41729, 2026-09-29) that introduced api/services/knowledge/datasets/. The same logic is applied to the pre-refactor files instead. Add two tests verifying that a maintainer can see their own dataset even when accessible_dataset_ids is empty, mirroring the maintainer visibility test added in the main branch PR. (cherry picked from commit a394d04)
xhdnoah
added a commit
to xhdnoah/dify
that referenced
this pull request
Oct 28, 2026
Remove the include_own_datasets parameter and the conditional gate so that maintainers always retain visibility of their own datasets when RBAC is enabled, matching the main branch behavior. The LTS branch predates the dataset application boundary refactor (langgenius#41729, 2026-09-29) that introduced api/services/knowledge/datasets/. The same logic is applied to the pre-refactor files instead. (cherry picked from commit a394d04)
xhdnoah
added a commit
to xhdnoah/dify
that referenced
this pull request
Oct 28, 2026
Remove the include_own_datasets parameter and the conditional gate so that maintainers always retain visibility of their own datasets when RBAC is enabled, matching the main branch behavior. The LTS branch predates the dataset application boundary refactor (langgenius#41729, 2026-09-29) that introduced api/services/knowledge/datasets/. The same logic is applied to the pre-refactor files instead. The main branch PR added a maintainer-visibility test with an empty accessible_dataset_ids list (test_list_visibility_restricts_even_requested_ids in test_adapters.py, introduced by langgenius#44605 on 2026-10-23). LTS forked on 2026-09-10 and never received that test. Add two equivalent tests to test_dataset_service_dataset.py covering the boundary scenario where accessible_dataset_ids is empty but the maintainer should still see their own dataset — this is the exact regression that langgenius#44795 fixes and the LTS existing tests only cover the non-empty case. (cherry picked from commit a394d04)
xhdnoah
added a commit
that referenced
this pull request
Oct 28, 2026
Remove the include_own_datasets parameter and the conditional gate so that maintainers always retain visibility of their own datasets when RBAC is enabled, matching the main branch behavior. The LTS branch predates the dataset application boundary refactor (#41729, 2026-09-29) that introduced api/services/knowledge/datasets/. The same logic is applied to the pre-refactor files instead. The main branch PR added a maintainer-visibility test with an empty accessible_dataset_ids list (test_list_visibility_restricts_even_requested_ids in test_adapters.py, introduced by #44605 on 2026-10-23). LTS forked on 2026-09-10 and never received that test. Add two equivalent tests to test_dataset_service_dataset.py covering the boundary scenario where accessible_dataset_ids is empty but the maintainer should still see their own dataset — this is the exact regression that #44795 fixes and the LTS existing tests only cover the non-empty case. (cherry picked from commit a394d04)
1 task done
6 tasks done
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
fix https://linear.app/dify/issue/CUS-1749/用户看不到自己创建的知识库
Screenshots
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint gods