Skip to content

refactor: migrate RecommendedApp to TypeBase#34808

Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom
sxxtony:refactor/migrate-recommended-app-to-typebase
Apr 13, 2026
Merged

refactor: migrate RecommendedApp to TypeBase#34808
asukaminato0721 merged 2 commits intolanggenius:mainfrom
sxxtony:refactor/migrate-recommended-app-to-typebase

Conversation

@sxxtony
Copy link
Copy Markdown
Contributor

@sxxtony sxxtony commented Apr 9, 2026

Summary

  • Migrate RecommendedApp from Base to TypeBase (MappedAsDataclass)
  • Add Mapped type annotations and dataclass-compatible mapped_column parameters
  • Reorder fields: required fields before optional ones to satisfy dataclass rules
  • Auto-generated fields (id, created_at, updated_at) use init=False

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 and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

Part of #23579

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. refactor labels Apr 9, 2026
@asukaminato0721 asukaminato0721 requested a review from Copilot April 9, 2026 05:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

Pyrefly Diff

No changes detected.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 RecommendedApp ORM model to use TypeBase (SQLAlchemy MappedAsDataclass) so it can participate in the codebase’s ongoing typed/dataclass-native model migration.

Changes:

  • Migrates RecommendedApp from Base to TypeBase.
  • Adds Mapped[...] type annotations and dataclass-compatible mapped_column(...) parameters (e.g., init=False, default_factory).
  • Reorders fields to satisfy dataclass required-before-optional rules and marks auto-generated fields as init=False.

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

Comment thread api/models/model.py
Comment thread api/models/model.py
Comment thread api/models/model.py
@sxxtony sxxtony requested a review from QuantumGhost as a code owner April 10, 2026 04:35
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 13, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 13, 2026
Merged via the queue into langgenius:main with commit ea9f74b Apr 13, 2026
27 checks passed
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
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:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants