refactor: EnumText for preferred_provider_type MessageChain, Banner#33696
Conversation
…, and ExporleBanner.status
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors several SQLAlchemy model columns to use Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Pyrefly DiffNo changes detected. |
There was a problem hiding this comment.
Code Review
This pull request effectively refactors the codebase to leverage EnumText for TenantPreferredModelProvider.preferred_provider_type, MessageChain.type, and ExporleBanner.status. This change significantly improves type safety and readability by allowing direct use of enum members instead of string literals, and correctly removes redundant .value_of() and .value conversions. The changes are well-implemented across models, controllers, and tests, demonstrating a thorough approach to the refactoring. All modifications align with the stated goals of the pull request and enhance the maintainability of the code.
Pyrefly DiffNo changes detected. |
|
@asukaminato0721 Please review my PR. Thanks. |
|
@asukaminato0721 Thank you. |
Summary
sa.StringwithEnumText(ProviderType)forTenantPreferredModelProvider.preferred_provider_typesa.StringwithEnumText(MessageChainType)forMessageChain.typesa.StringwithEnumText(BannerStatus)forExporleBanner.statusProviderType.value_of()and.valueconversionsContinues #33294 (provider + model domain, part 2)
Details
TenantPreferredModelProvider.preferred_provider_typeString(40)EnumText(ProviderType)MessageChain.typeString(255)EnumText(MessageChainType)ExporleBanner.statusString(255)EnumText(BannerStatus)With
EnumText, the column now returns the enum directly — no need forProviderType.value_of()to parse the raw string on read, or.valueto extract the string on write.Test plan
basedpyrightpasses (0 errors on changed files)🤖 Generated with Claude Code