Skip to content

refactor: update get_redis return type and clean up main.py imports#7

Merged
Ruixiaoke merged 3 commits intomainfrom
fix-cicd-again
Nov 6, 2025
Merged

refactor: update get_redis return type and clean up main.py imports#7
Ruixiaoke merged 3 commits intomainfrom
fix-cicd-again

Conversation

@Ruixiaoke
Copy link
Contributor

This pull request includes minor improvements to the codebase for better reliability and clarity. The main changes involve correcting the type annotation for the Redis client and reorganizing the import logic in the main application file.

Code quality and reliability:

  • Updated the return type annotation of the get_redis function in app/infrastructure/redis_client.py to use the generic Redis type, improving compatibility and type correctness.

Code organization:

  • Moved the logic for adding the app directory to the Python path to the top of app/main.py, ensuring proper module resolution before other imports.

@Ruixiaoke Ruixiaoke requested a review from Copilot November 6, 2025 13:38
Copy link

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

This PR contains two refactoring changes: relocating the Python path modification to occur before module imports in main.py, and simplifying the Redis type hint in redis_client.py.

  • Moved the Python path setup code to execute before imports to ensure proper module resolution
  • Removed the generic type parameter [str] from the Redis type hint for cleaner typing

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/main.py Relocated sys.path.insert() to execute before module imports
app/infrastructure/redis_client.py Simplified Redis return type annotation from Redis[str] to Redis

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

@Ruixiaoke Ruixiaoke merged commit cf8104c into main Nov 6, 2025
1 check passed
sguming added a commit that referenced this pull request Nov 6, 2025
sguming added a commit that referenced this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants