From fcffe68f19c6b2cbe1370a9b797570f735d8fad3 Mon Sep 17 00:00:00 2001 From: Casey Jao Date: Fri, 17 Jan 2025 10:35:40 -0500 Subject: [PATCH] Remove unused code --- covalent_dispatcher/_dal/result.py | 36 ------------------- .../_dal/result_test.py | 9 ----- 2 files changed, 45 deletions(-) diff --git a/covalent_dispatcher/_dal/result.py b/covalent_dispatcher/_dal/result.py index 489efe11d..27b073ffa 100644 --- a/covalent_dispatcher/_dal/result.py +++ b/covalent_dispatcher/_dal/result.py @@ -21,7 +21,6 @@ from datetime import datetime from typing import Any, Dict, List -from sqlalchemy import select from sqlalchemy.orm import Session from covalent._shared_files import logger @@ -46,41 +45,6 @@ class ResultMeta(Record[models.Lattice]): model = models.Lattice - @classmethod - def get_toplevel_dispatches( - cls, - session: Session, - *, - fields: list, - equality_filters: dict, - membership_filters: dict, - for_update: bool = False, - sort_fields: List[str] = [], - reverse: bool = True, - offset: int = 0, - max_items: int = 10, - ): - if len(fields) > 0: - entities = [getattr(cls.model, attr) for attr in fields] - stmt = select(*entities) - else: - stmt = select(cls.model) - - stmt = stmt.where(models.Lattice.root_dispatch_id == models.Lattice.dispatch_id) - - return cls.get( - session=session, - stmt=stmt, - fields=fields, - equality_filters=equality_filters, - membership_filters=membership_filters, - for_update=for_update, - sort_fields=sort_fields, - reverse=reverse, - offset=offset, - max_items=max_items, - ) - class ResultAsset(Record[models.LatticeAsset]): model = models.LatticeAsset diff --git a/tests/covalent_dispatcher_tests/_dal/result_test.py b/tests/covalent_dispatcher_tests/_dal/result_test.py index cb858ebb5..7c3d3d846 100644 --- a/tests/covalent_dispatcher_tests/_dal/result_test.py +++ b/tests/covalent_dispatcher_tests/_dal/result_test.py @@ -598,15 +598,6 @@ def test_result_controller_bulk_get(test_db, mocker): ) assert len(results) == 3 - with test_db.session() as session: - results = dispatch_controller.get_toplevel_dispatches( - session, - fields=["dispatch_id"], - equality_filters={}, - membership_filters={}, - ) - assert len(results) == 2 - with test_db.session() as session: results = dispatch_controller.get( session,