Skip to content

refactor: replace dict params with BaseModel payloads in TagService#34422

Merged
asukaminato0721 merged 2 commits into
langgenius:mainfrom
YB0y:refactor/pass-basemodel-instead-of-dict-tag-service
Apr 7, 2026
Merged

refactor: replace dict params with BaseModel payloads in TagService#34422
asukaminato0721 merged 2 commits into
langgenius:mainfrom
YB0y:refactor/pass-basemodel-instead-of-dict-tag-service

Conversation

@YB0y

@YB0y YB0y commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of #31497

Before: TagService.save_tags, update_tags, save_tag_binding, and delete_tag_binding accepted raw dict args, with callers either calling .model_dump() on already-validated Pydantic models or manually constructing dicts.

After: Four new typed payloads (SaveTagPayload, UpdateTagPayload, TagBindingCreatePayload, TagBindingDeletePayload) defined in the service layer. All callers in console and service API controllers now construct and pass these models directly, eliminating dict intermediaries and gaining compile-time type safety with Pydantic validation.

Files changed

  • api/services/tag_service.py — new payload models + updated method signatures
  • api/controllers/console/tag/tags.py — pass models instead of .model_dump()
  • api/controllers/service_api/dataset/dataset.py — pass models instead of hand-built dicts

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. refactor labels Apr 1, 2026
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-01 18:32:50.695164697 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-01 18:32:39.534251583 +0000
@@ -20,6 +20,14 @@
   --> controllers/console/setup.py:40:2
 ERROR Object of class `MissingRouter` has no attribute `post` [missing-attribute]
   --> controllers/console/setup.py:65:2
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.SaveTagPayload.__init__` [bad-argument-type]
+  --> controllers/console/tag/tags.py:85:75
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.UpdateTagPayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:106:79
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.TagBindingCreatePayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:139:120
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.TagBindingDeletePayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:157:120
 ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
   --> controllers/console/version.py:30:2
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunk] | LLMResult` [unsafe-overlap]
@@ -1202,6 +1210,36 @@
    --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:691:39
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:729:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:733:34
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:753:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:759:41
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:800:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:821:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:824:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:831:36
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:992:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1034:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1037:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1077:41
+ERROR Argument `dict[str, str | Unknown]` is not assignable to parameter `payload` with type `TagBindingDeletePayload` in function `services.tag_service.TagService.delete_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1117:39
+ERROR Argument `dict[str, str | Unknown]` is not assignable to parameter `payload` with type `TagBindingDeletePayload` in function `services.tag_service.TagService.delete_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1153:39
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2164,6 +2202,8 @@
    --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:217:29
 ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
    --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:778:16
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:873:39
 ERROR Argument `list[dict[str, Any]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
   --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:51:20
 ERROR `None` is not subscriptable [unsupported-operation]

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 1, 2026
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-01 18:34:44.248083765 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-01 18:34:33.284037290 +0000
@@ -20,6 +20,14 @@
   --> controllers/console/setup.py:40:2
 ERROR Object of class `MissingRouter` has no attribute `post` [missing-attribute]
   --> controllers/console/setup.py:65:2
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.SaveTagPayload.__init__` [bad-argument-type]
+  --> controllers/console/tag/tags.py:91:75
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.UpdateTagPayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:112:79
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.TagBindingCreatePayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:146:96
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.TagBindingDeletePayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:166:94
 ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
   --> controllers/console/version.py:30:2
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunk] | LLMResult` [unsafe-overlap]
@@ -1202,6 +1210,36 @@
    --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:691:39
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:729:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:733:34
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:753:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:759:41
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:800:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:821:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:824:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:831:36
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:992:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1034:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1037:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1077:41
+ERROR Argument `dict[str, str | Unknown]` is not assignable to parameter `payload` with type `TagBindingDeletePayload` in function `services.tag_service.TagService.delete_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1117:39
+ERROR Argument `dict[str, str | Unknown]` is not assignable to parameter `payload` with type `TagBindingDeletePayload` in function `services.tag_service.TagService.delete_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1153:39
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2164,6 +2202,8 @@
    --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:217:29
 ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
    --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:778:16
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:873:39
 ERROR Argument `list[dict[str, Any]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
   --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:51:20
 ERROR `None` is not subscriptable [unsupported-operation]

@bri-tong

bri-tong commented Apr 1, 2026

Copy link
Copy Markdown

Code Review

Summary

Clean refactoring that replaces raw dict parameters with typed Pydantic BaseModel payloads in TagService. The direction is good — it improves type safety at the service boundary and catches invalid inputs earlier via Pydantic validation. However, the existing test suites were not updated and will break at runtime, and there is a type-narrowing issue when the console controller passes None into the new non-optional type field.


Blocking Issues

1. Tests not updated — will fail at runtime

All integration tests in api/tests/test_containers_integration_tests/services/test_tag_service.py still pass raw dict arguments to the refactored methods:

# Line 691
tag_args = {"name": "test_tag_name", "type": "knowledge"}
result = TagService.save_tags(tag_args)  # Now expects SaveTagPayload, not dict

# Line 759
result = TagService.update_tags(update_args, tag.id)  # Now expects UpdateTagPayload

# Line 992
TagService.save_tag_binding(binding_args)  # Now expects TagBindingCreatePayload

# Line 1117
TagService.delete_tag_binding(delete_args)  # Now expects TagBindingDeletePayload

The unit test in api/tests/unit_tests/controllers/service_api/dataset/test_dataset.py (line 873) also passes a raw dict:

result = TagService.save_tags({"name": "New Tag", "type": "knowledge"})

All of these will raise TypeError or ValidationError since the methods now expect BaseModel instances. These tests must be updated to construct the new payload models.

2. type: None from console controller will cause Pydantic ValidationError

In api/controllers/console/tag/tags.py, the controller-level models allow type to be None:

class TagBasePayload(BaseModel):
    type: Literal["knowledge", "app"] | None = Field(default=None, ...)

But the new service-level payloads require it:

class SaveTagPayload(BaseModel):
    type: TagTypeStr  # Literal["knowledge", "app"] — no None allowed

When a console API request omits type, payload.type is None, and constructing SaveTagPayload(name=payload.name, type=None) will raise a Pydantic ValidationError. This applies to all four console controller call sites (SaveTagPayload, UpdateTagPayload, TagBindingCreatePayload, TagBindingDeletePayload).

Note: the old code would also fail later at TagType(None), so this isn't a net-new failure mode. But since this PR is adding explicit validation, consider also fixing the controller-level models to make type required:

class TagBasePayload(BaseModel):
    name: str = Field(..., min_length=1, max_length=50)
    type: Literal["knowledge", "app"]  # Remove | None

Non-blocking Suggestions

3. SaveTagPayload and UpdateTagPayload are structurally identical

Both have exactly name: str + type: TagTypeStr. Consider a shared base to reduce duplication:

class _TagPayloadBase(BaseModel):
    name: str = Field(min_length=1, max_length=50)
    type: TagTypeStr

class SaveTagPayload(_TagPayloadBase): pass
class UpdateTagPayload(_TagPayloadBase): pass

This preserves separate types for independent evolution while eliminating the duplicated field definitions.

4. Model placement is inconsistent with codebase convention

Other services (e.g., services/entities/knowledge_entities/) place payload/entity models in a separate entities/ directory. Defining them inline in tag_service.py works but diverges from the existing pattern. Consider moving to services/entities/tag_entities.py for consistency, especially if more tag-related models are added later.

5. Minor: variable rename in delete_tag_binding is a nice bonus cleanup

The rename from tag_bindingstag_binding (singular) correctly reflects that .first() returns a single result. 👍


Questions / Clarifications

  • Is the type: None default in the console controller models (TagBasePayload, TagBindingPayload, TagBindingRemovePayload) intentionally allowed by the frontend, or is it effectively dead code? If it's dead code, cleaning it up as part of this PR would make the type contracts fully consistent across layers.

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

Refactors the backend tag APIs to pass typed Pydantic BaseModel payloads into TagService instead of raw dicts, aiming to remove dict intermediaries and tighten validation/type-safety across controllers and the service layer.

Changes:

  • Introduced service-layer Pydantic payload models for tag creation/update and tag binding create/delete.
  • Updated TagService method signatures to accept these payload models instead of dict.
  • Updated console + service API controllers to construct and pass the new payload models.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
api/services/tag_service.py Adds new payload models and updates TagService method signatures/usage to accept models.
api/controllers/console/tag/tags.py Updates console endpoints to pass TagService typed payloads instead of model_dump() dicts.
api/controllers/service_api/dataset/dataset.py Updates dataset service API endpoints to pass typed payloads instead of hand-built dicts.

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

Comment thread api/controllers/console/tag/tags.py
Comment thread api/controllers/console/tag/tags.py
Comment thread api/controllers/console/tag/tags.py
Comment thread api/controllers/console/tag/tags.py
Comment thread api/services/tag_service.py
Comment thread api/services/tag_service.py Outdated
Comment thread api/services/tag_service.py Outdated
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Apr 2, 2026
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-02 07:13:14.664220909 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-02 07:13:04.506085382 +0000
@@ -12,6 +12,14 @@
   --> controllers/console/setup.py:40:2
 ERROR Object of class `MissingRouter` has no attribute `post` [missing-attribute]
   --> controllers/console/setup.py:65:2
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.SaveTagPayload.__init__` [bad-argument-type]
+  --> controllers/console/tag/tags.py:91:75
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.UpdateTagPayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:112:79
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.TagBindingCreatePayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:146:96
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.TagBindingDeletePayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:166:94
 ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
   --> controllers/console/version.py:30:2
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunk] | LLMResult` [unsafe-overlap]
@@ -412,6 +420,12 @@
    --> services/summary_index_service.py:409:24
 ERROR Argument `datetime | object` is not assignable to parameter `value` with type `SQLCoreOperations[datetime] | datetime` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> services/summary_index_service.py:410:53
+ERROR Could not find name `payload` [unknown-name]
+   --> services/tag_service.py:165:27
+ERROR Could not find name `tag_binding` [unknown-name]
+   --> services/tag_service.py:182:12
+ERROR Could not find name `tag_binding` [unknown-name]
+   --> services/tag_service.py:183:31
 ERROR Object of class `dict` has no attribute `encode`
 ERROR Object of class `dict` has no attribute `encode`
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[Mapping[str, Any] | str] | Mapping[str, Any]` [unsafe-overlap]
@@ -1194,6 +1208,24 @@
    --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:691:39
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:729:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:733:34
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:753:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:759:41
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:800:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:821:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:824:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:831:36
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2146,6 +2178,8 @@
    --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:217:29
 ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
    --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:778:16
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/unit_tests/controllers/service_api/dataset/test_dataset.py:873:39
 ERROR Argument `list[dict[str, Any]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
   --> tests/unit_tests/controllers/service_api/dataset/test_dataset_segment.py:51:20
 ERROR `None` is not subscriptable [unsupported-operation]

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-03 03:51:20.936728688 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-03 03:51:11.974814635 +0000
@@ -12,6 +12,14 @@
   --> controllers/console/setup.py:40:2
 ERROR Object of class `MissingRouter` has no attribute `post` [missing-attribute]
   --> controllers/console/setup.py:65:2
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.SaveTagPayload.__init__` [bad-argument-type]
+  --> controllers/console/tag/tags.py:91:75
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.UpdateTagPayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:112:79
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.TagBindingCreatePayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:146:96
+ERROR Argument `Literal['app', 'knowledge'] | None` is not assignable to parameter `type` with type `Literal['app', 'knowledge']` in function `services.tag_service.TagBindingDeletePayload.__init__` [bad-argument-type]
+   --> controllers/console/tag/tags.py:166:94
 ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
   --> controllers/console/version.py:30:2
 ERROR Class member `EasyUIBasedGenerateTaskPipeline._application_generate_entity` overrides parent class `BasedGenerateTaskPipeline` in an inconsistent manner [bad-override]
@@ -343,6 +351,12 @@
   --> services/document_indexing_proxy/duplicate_document_indexing_task_proxy.py:15:5
 ERROR `handled_tenant_count` was assigned in the current scope before the nonlocal declaration [unknown-name]
   --> services/plugin/plugin_migration.py:81:34
+ERROR Could not find name `payload` [unknown-name]
+   --> services/tag_service.py:165:27
+ERROR Could not find name `tag_binding` [unknown-name]
+   --> services/tag_service.py:182:12
+ERROR Could not find name `tag_binding` [unknown-name]
+   --> services/tag_service.py:183:31
 ERROR Object of class `dict` has no attribute `encode`
 ERROR Object of class `dict` has no attribute `encode`
 ERROR Returned type `EndUser | Unknown | None` is not assignable to declared return type `Account | EndUser` [bad-return]
@@ -1113,6 +1127,24 @@
    --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:691:39
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:729:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:733:34
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:753:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:759:41
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:800:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:821:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:824:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:831:36
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@YB0y YB0y force-pushed the refactor/pass-basemodel-instead-of-dict-tag-service branch from 64fb557 to 23a268f Compare April 3, 2026 16:46
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 3, 2026
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-03 16:47:47.845637925 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-03 16:47:39.423677113 +0000
@@ -1117,6 +1117,36 @@
    --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:691:39
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:729:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:733:34
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:753:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:759:41
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:800:36
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:821:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `SaveTagPayload` in function `services.tag_service.TagService.save_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:824:37
+ERROR Argument `dict[str, str]` is not assignable to parameter `payload` with type `UpdateTagPayload` in function `services.tag_service.TagService.update_tags` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:831:36
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:992:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1034:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1037:37
+ERROR Argument `dict[str, list[Unknown] | str]` is not assignable to parameter `payload` with type `TagBindingCreatePayload` in function `services.tag_service.TagService.save_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1077:41
+ERROR Argument `dict[str, str | Unknown]` is not assignable to parameter `payload` with type `TagBindingDeletePayload` in function `services.tag_service.TagService.delete_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1117:39
+ERROR Argument `dict[str, str | Unknown]` is not assignable to parameter `payload` with type `TagBindingDeletePayload` in function `services.tag_service.TagService.delete_tag_binding` [bad-argument-type]
+    --> tests/test_containers_integration_tests/services/test_tag_service.py:1153:39
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@YB0y YB0y force-pushed the refactor/pass-basemodel-instead-of-dict-tag-service branch from 23a268f to c49b5ed Compare April 3, 2026 16:57
@YB0y YB0y requested a review from laipz8200 as a code owner April 3, 2026 16:57
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-03 16:59:50.470200888 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-03 16:59:40.496185249 +0000
@@ -1106,17 +1106,17 @@
 ERROR Argument `Literal['end_user']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.web.SavedMessage.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_saved_message_service.py:602:67
 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_tag_service.py:53:20
+  --> tests/test_containers_integration_tests/services/test_tag_service.py:59: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_tag_service.py:62:20
+  --> tests/test_containers_integration_tests/services/test_tag_service.py:68:20
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:330:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:336:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:339:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:345:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:354:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:364:18
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-03 17:01:58.587103873 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-03 17:01:49.810081123 +0000
@@ -1106,17 +1106,17 @@
 ERROR Argument `Literal['end_user']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.web.SavedMessage.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_saved_message_service.py:602:67
 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_tag_service.py:53:20
+  --> tests/test_containers_integration_tests/services/test_tag_service.py:59: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_tag_service.py:62:20
+  --> tests/test_containers_integration_tests/services/test_tag_service.py:68:20
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:330:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:336:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:339:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:345:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:354:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:364:18
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@YB0y YB0y force-pushed the refactor/pass-basemodel-instead-of-dict-tag-service branch from e6a3854 to c0943f8 Compare April 3, 2026 17:33
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-03 17:34:04.614494797 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-03 17:33:55.041383530 +0000
@@ -1106,17 +1106,17 @@
 ERROR Argument `Literal['end_user']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.web.SavedMessage.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_saved_message_service.py:602:67
 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_tag_service.py:53:20
+  --> tests/test_containers_integration_tests/services/test_tag_service.py:59: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_tag_service.py:62:20
+  --> tests/test_containers_integration_tests/services/test_tag_service.py:68:20
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:330:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:336:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:339:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:345:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:354:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:364:18
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-03 17:36:06.913159341 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-03 17:35:57.047124872 +0000
@@ -1106,17 +1106,17 @@
 ERROR Argument `Literal['end_user']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.web.SavedMessage.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_saved_message_service.py:602:67
 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_tag_service.py:53:20
+  --> tests/test_containers_integration_tests/services/test_tag_service.py:59: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_tag_service.py:62:20
+  --> tests/test_containers_integration_tests/services/test_tag_service.py:68:20
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:330:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:336:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:339:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:345:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:348:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:354:18
 ERROR Argument `Literal['app']` is not assignable to parameter `type` with type `SQLCoreOperations[TagType] | TagType` in function `models.model.Tag.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_tag_service.py:358:18
+   --> tests/test_containers_integration_tests/services/test_tag_service.py:364:18
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_trigger_provider_service.py:169:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@YB0y

YB0y commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @asukaminato0721, is this PR not ready to be merged? Could you please provide any feedback?

Comment thread api/controllers/console/tag/tags.py
Comment thread api/controllers/console/tag/tags.py
Comment thread api/controllers/console/tag/tags.py
@YB0y

YB0y commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

Hi @asukaminato0721, sorry for the ping. @dosu mentioned that my approach looks good. could you share your thoughts as well?

@dosubot

dosubot Bot commented Apr 7, 2026

Copy link
Copy Markdown

Just to clarify — I'm Dosu, an AI knowledge agent, not a maintainer. I provided an automated code review with suggestions, but I don't have the authority to approve or merge PRs.

You'll still need a maintainer (like @asukaminato0721) to review and approve the changes. The review feedback from @bri-tong raised some valid blocking issues (test updates and the type: None validation gap) that would be worth addressing to help move this along. Hope you get the maintainer feedback soon!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Chat with Dosu Open in Cursor  Share on X

@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 7, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 7, 2026
Merged via the queue into langgenius:main with commit f67a811 Apr 7, 2026
27 checks passed
@YB0y YB0y deleted the refactor/pass-basemodel-instead-of-dict-tag-service branch April 8, 2026 13:35
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
…anggenius#34422)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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 refactor size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants