Repository navigation
Conversation
Contributor
Author
|
Hi maintainers, the branch has been updated and all local backend checks passed ( |
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-11-02 21:00:46.550580213 +0000
+++ /tmp/pyrefly_pr.txt 2026-11-02 21:00:34.949520749 +0000
@@ -2884,8 +2884,14 @@
--> tests/unit_tests/controllers/service_api/test_wraps.py:415:16
ERROR Argument `Literal['abnormal']` is not assignable to parameter `value` with type `AppStatus | SQLCoreOperations[AppStatus]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> tests/unit_tests/controllers/service_api/test_wraps.py:450:28
+ERROR Object of class `NoneType` has no attribute `tenant_id` [missing-attribute]
+ --> tests/unit_tests/controllers/service_api/test_wraps.py:893:16
+ERROR Object of class `NoneType` has no attribute `dataset_ids` [missing-attribute]
+ --> tests/unit_tests/controllers/service_api/test_wraps.py:894:16
+ERROR Object of class `NoneType` has no attribute `dataset_ids` [missing-attribute]
+ --> tests/unit_tests/controllers/service_api/test_wraps.py:961:16
ERROR Object of class `NoneType` has no attribute `last_used_at` [missing-attribute]
- --> tests/unit_tests/controllers/service_api/test_wraps.py:951:16
+ --> tests/unit_tests/controllers/service_api/test_wraps.py:963:16
ERROR `object` is not assignable to attribute `request` with type `Request` [bad-assignment]
--> tests/unit_tests/controllers/trigger/test_trigger.py:11:22
ERROR Object of class `tuple` has no attribute `status_code` [missing-attribute]
@@ -5939,41 +5945,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:1438:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1519: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:1753:26
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1834: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:1759:25
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1840: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:1776:22
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1857: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:1797:37
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:1878: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:2037:30
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2118: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:2043:33
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2124:33
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2068:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2149:20
ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2069:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2150: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:2511:30
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2592: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:2517:33
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2598:33
ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2596:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2677:20
ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2695:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2776: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:2799:24
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2880:24
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:2800:20
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:2881:20
ERROR Object of class `NoneType` has no attribute `rules` [missing-attribute]
- --> tests/unit_tests/services/knowledge/test_dataset_service.py:3800:42
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:3881: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:4235:25
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:4316: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:4236:18
+ --> tests/unit_tests/services/knowledge/test_dataset_service.py:4317: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 Object of class `NoneType` has no attribute `marked_name` [missing-attribute]
|
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44840 +/- ##
==========================================
- Coverage 89.77% 89.77% -0.01%
==========================================
Files 6239 6239
Lines 390902 390924 +22
Branches 79285 79291 +6
==========================================
+ Hits 350934 350950 +16
- Misses 33870 33875 +5
- Partials 6098 6099 +1
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:
|
laipz8200
force-pushed
the
fix/issue-41316-dataset-service-api-permissions
branch
from
November 2, 2026 20:58
a341277 to
109dde3
Compare
laipz8200
approved these changes
Nov 2, 2026
laipz8200
left a comment
Member
There was a problem hiding this comment.
LGTM. Thank you for your contribution!
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
Fixes #41316.
This PR fixes inconsistent Dataset Service API authorization caused by evaluating dataset visibility against the workspace Owner injected into
current_user, rather than the permissions granted to the API token.The change:
include_all=truefrom widening a resource token's authorization scope.No new runtime dependencies are introduced.
Validation completed:
git diff --checkpassed.Screenshots
This is a backend-only authorization change, so screenshots are not applicable.
Checklist
make lint && make type-check(backend).vp stagedis not applicable because this PR contains no frontend changes.