Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
cjao committed Jan 17, 2025
1 parent 82e46de commit fcffe68
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
36 changes: 0 additions & 36 deletions covalent_dispatcher/_dal/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 0 additions & 9 deletions tests/covalent_dispatcher_tests/_dal/result_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fcffe68

Please sign in to comment.