Skip to content

nit: fixed import order#1442

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
tisnik:nit-fixed-sort-imports
Mar 31, 2026
Merged

nit: fixed import order#1442
tisnik merged 1 commit into
lightspeed-core:mainfrom
tisnik:nit-fixed-sort-imports

Conversation

@tisnik

@tisnik tisnik commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

nit: fixed import order

Summary by CodeRabbit

  • Chores
    • Internal code organization improvements with no impact on user-facing functionality.

@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a1590ef4-da7b-4afd-bf11-92343798c4cc

📥 Commits

Reviewing files that changed from the base of the PR and between 18b9a10 and c45a9ea.

📒 Files selected for processing (2)
  • src/app/endpoints/streaming_query.py
  • src/app/main.py
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build-pr
  • GitHub Check: unit_tests (3.12)
  • GitHub Check: bandit
  • GitHub Check: unit_tests (3.13)
  • GitHub Check: E2E: library mode / ci
  • GitHub Check: E2E: server mode / ci
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Use absolute imports for internal modules from the Lightspeed Core Stack (e.g., from authentication import get_auth_dependency)

Files:

  • src/app/endpoints/streaming_query.py
  • src/app/main.py
src/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.py: Use FastAPI imports from the fastapi module: from fastapi import APIRouter, HTTPException, Request, status, Depends
Use from llama_stack_client import AsyncLlamaStackClient for Llama Stack client imports
Check constants.py for shared constants before defining new ones
All modules must start with descriptive docstrings explaining purpose
Use logger = get_logger(__name__) from log.py for module logging
Define type aliases at module level for clarity in Lightspeed Core Stack
All functions require docstrings with brief descriptions following Google Python docstring conventions
Use complete type annotations for function parameters and return types
Use modern union type syntax str | int instead of Union[str, int] for type annotations
Use Optional[Type] for nullable types in type annotations
Use snake_case with descriptive, action-oriented names for functions (e.g., get_, validate_, check_)
Avoid in-place parameter modification anti-patterns; return new data structures instead
Use async def for functions performing I/O operations and external API calls
Handle APIConnectionError from Llama Stack in error handling logic
Use standard log levels appropriately: debug for diagnostic info, info for general execution, warning for unexpected events, error for serious problems
All classes require descriptive docstrings explaining their purpose
Use PascalCase for class names with descriptive names and standard suffixes (Configuration, Error/Exception, Resolver, Interface)
Use ABC (Abstract Base Classes) with @abstractmethod decorators for interface implementations
Use complete type annotations for all class attributes; avoid using Any type
Follow Google Python docstring conventions with Parameters, Returns, Raises, and Attributes sections as needed

Files:

  • src/app/endpoints/streaming_query.py
  • src/app/main.py
src/app/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Use FastAPI HTTPException with appropriate status codes for API endpoint error handling

Files:

  • src/app/endpoints/streaming_query.py
  • src/app/main.py
🔇 Additional comments (2)
src/app/main.py (1)

19-19: Import reorder is clean and compliant.

This move preserves absolute internal imports and does not introduce functional risk.

src/app/endpoints/streaming_query.py (1)

59-59: Constants import reorder looks good.

Ordering-only update; no functional or interface changes introduced.


Walkthrough

Import statements were reordered in two files: TOPIC_SUMMARY_INTERRUPT_TIMEOUT_SECONDS was moved within the constants import list in streaming_query.py, and shutdown_background_topic_summary_tasks was repositioned relative to database imports in main.py. No functional logic or control flow was modified.

Changes

Cohort / File(s) Summary
Import Reordering
src/app/endpoints/streaming_query.py
Reordered TOPIC_SUMMARY_INTERRUPT_TIMEOUT_SECONDS import within the constants import list to appear after media type constants.
Import Reordering
src/app/main.py
Moved shutdown_background_topic_summary_tasks import to appear after database-related imports instead of before them.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'nit: fixed import order' accurately reflects the main change: reordering imports in two files without modifying runtime logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tisnik
tisnik merged commit 29ab42f into lightspeed-core:main Mar 31, 2026
20 of 24 checks passed
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.

1 participant