Skip to content

Commit

Permalink
Remove useless load_table
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Mar 7, 2024
1 parent 4902ae0 commit 831c00d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
8 changes: 0 additions & 8 deletions src/ai/backend/manager/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,14 +1167,6 @@ def set_if_set(
target[target_key or name] = v


async def load_table(engine: SAEngine, table_name: str) -> sa.Table:
async with engine.begin() as conn:
return await conn.run_sync(
lambda conn, table_name: sa.Table(table_name, sa.MetaData(), autoload_with=conn),
table_name,
)


async def populate_fixture(
engine: SAEngine,
fixture_data: Mapping[str, str | Sequence[dict[str, Any]]],
Expand Down
7 changes: 2 additions & 5 deletions tests/manager/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,10 @@
vfolders,
)
from ai.backend.manager.models.base import (
metadata,
pgsql_connect_opts,
populate_fixture,
)

# from ai.backend.manager.models.container_registry import ContainerRegistry
from ai.backend.manager.models.container_registry import ContainerRegistry
from ai.backend.manager.models.scaling_group import ScalingGroupOpts
from ai.backend.manager.models.utils import connect_database
from ai.backend.manager.registry import AgentRegistry
Expand Down Expand Up @@ -467,8 +465,7 @@ async def clean_fixture():
await conn.execute((users.delete()))
await conn.execute((scaling_groups.delete()))
await conn.execute((domains.delete()))
# await conn.execute(((await load_table(engine, "container_registries")).delete()))
await conn.execute((metadata.tables.get("container_registries")))
await conn.execute((ContainerRegistry.__table__.delete()))
finally:
await engine.dispose()

Expand Down

0 comments on commit 831c00d

Please sign in to comment.