-
Notifications
You must be signed in to change notification settings - Fork 461
Open
Labels
Geti Tune BackendIssues related to Geti Tune Studio backendIssues related to Geti Tune Studio backendpythonPull requests that update Python codePull requests that update Python code
Description
Refactor the project’s SQLAlchemy integration to align with best practices and the latest API standards.
Acceptance Criteria:
- Session factory improvements: update
SessionLocal
to useautoflush=True
behavior by default to reduce boilerplate. - Session DI: define
db_session
as a dependency and inject into services. (this will help to avoid monkeypatching in tests) - No caching for stateless services: most of the services are stateless, we can avoid using
@lru_cache
with it. - Upgrade to the latest 2.0
SQLAlchemy API
:- Identify and refactor all usages of legacy SQLAlchemy APIs (e.g.,
db.query
) to use the recommended modern API (e.g.,db.execute(select(...))
) - Update repository code and ensure all queries use the latest patterns.
- Identify and refactor all usages of legacy SQLAlchemy APIs (e.g.,
- Testing improvements: review unit tests and replace monkeypatching of database/session logic with dependency injection or fixtures where possible.
Metadata
Metadata
Assignees
Labels
Geti Tune BackendIssues related to Geti Tune Studio backendIssues related to Geti Tune Studio backendpythonPull requests that update Python codePull requests that update Python code