[PR #32189] chore: remove unnecessary # type: ignore from request.args.to_dict() calls #33601

Closed
opened 2026-02-21 20:53:34 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/32189

State: closed
Merged: No


Summary

Remove 55 # type: ignore comments from 26 controller files where request.args.to_dict(flat=True) is passed to pydantic's model_validate().

Since model_validate() accepts Any as its first parameter, these type ignore suppressions are unnecessary and prevent proper type checking.

Pattern removed

# Before
args = SomeModel.model_validate(request.args.to_dict(flat=True))  # type: ignore

# After  
args = SomeModel.model_validate(request.args.to_dict(flat=True))

Changes

  • 26 files modified in api/controllers/ and api/events/
  • 55 # type: ignore comments removed (all following the same pattern)
  • No functional changes — purely type annotation cleanup

Relates to #24494

Disclosure: This PR was prepared with AI assistance for identifying the repetitive pattern across files.

**Original Pull Request:** https://github.com/langgenius/dify/pull/32189 **State:** closed **Merged:** No --- ## Summary Remove 55 `# type: ignore` comments from 26 controller files where `request.args.to_dict(flat=True)` is passed to pydantic's `model_validate()`. Since `model_validate()` accepts `Any` as its first parameter, these type ignore suppressions are unnecessary and prevent proper type checking. ## Pattern removed ```python # Before args = SomeModel.model_validate(request.args.to_dict(flat=True)) # type: ignore # After args = SomeModel.model_validate(request.args.to_dict(flat=True)) ``` ## Changes - 26 files modified in `api/controllers/` and `api/events/` - 55 `# type: ignore` comments removed (all following the same pattern) - No functional changes — purely type annotation cleanup Relates to #24494 **Disclosure**: This PR was prepared with AI assistance for identifying the repetitive pattern across files.
yindo added the pull-request label 2026-02-21 20:53:34 -05:00
yindo closed this issue 2026-02-21 20:53:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33601