Skip to content

Commit

Permalink
Ruff 🐶
Browse files Browse the repository at this point in the history
  • Loading branch information
anticorrelator committed Sep 20, 2024
1 parent 165bec1 commit 7b0bcbc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
7 changes: 1 addition & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
import contextlib
from asyncio import AbstractEventLoop, get_running_loop
from asyncio import AbstractEventLoop
from functools import partial
from importlib.metadata import version
from random import getrandbits
Expand Down Expand Up @@ -199,11 +199,6 @@ async def app(
yield manager.app


@pytest.fixture
async def loop() -> AbstractEventLoop:
return get_running_loop()


@pytest.fixture
def httpx_clients(
app: ASGIApp,
Expand Down
22 changes: 12 additions & 10 deletions tests/datasets/test_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from unittest.mock import patch

import httpx
import pytest
from sqlalchemy import select
from strawberry.relay import GlobalID

Expand Down Expand Up @@ -37,8 +36,8 @@ async def test_run_experiment(
simple_dataset: Any,
dialect: str,
) -> None:
if dialect == "postgresql":
pytest.xfail("TODO: Convert this to an integration test")
# if dialect == "postgresql":
# pytest.xfail("TODO: Convert this to an integration test")

async with db() as session:
nonexistent_experiment = (await session.execute(select(models.Experiment))).scalar()
Expand Down Expand Up @@ -103,16 +102,18 @@ def experiment_task(_) -> Dict[str, str]:

# Wait until all evaluations are complete
async def wait_for_evaluations():
timeout = 10
timeout = 30
interval = 0.5
total_wait = 0
while total_wait < timeout:
async with db() as session:
evaluations = (
(
await session.execute(
select(models.ExperimentRunAnnotation)
.where(models.ExperimentRunAnnotation.experiment_run_id == experiment_id)
select(models.ExperimentRunAnnotation).where(
models.ExperimentRunAnnotation.experiment_run_id
== experiment_id
)
)
)
.scalars()
Expand All @@ -124,6 +125,7 @@ async def wait_for_evaluations():
total_wait += interval
else:
raise TimeoutError("Evaluations did not complete in time")

await wait_for_evaluations()

experiment_model = (await session.execute(select(models.Experiment))).scalar()
Expand Down Expand Up @@ -178,8 +180,8 @@ async def test_run_experiment_with_llm_eval(
simple_dataset: Any,
dialect: str,
) -> None:
if dialect == "postgresql":
pytest.xfail("This test fails on PostgreSQL")
# if dialect == "postgresql":
# pytest.xfail("This test fails on PostgreSQL")

async with db() as session:
nonexistent_experiment = (await session.execute(select(models.Experiment))).scalar()
Expand Down Expand Up @@ -290,8 +292,8 @@ async def test_run_evaluation(
simple_dataset_with_one_experiment_run: Any,
dialect: str,
) -> None:
if dialect == "postgresql":
pytest.xfail("This test fails on PostgreSQL")
# if dialect == "postgresql":
# pytest.xfail("This test fails on PostgreSQL")

experiment = Experiment(
id=str(GlobalID("Experiment", "0")),
Expand Down
3 changes: 0 additions & 3 deletions tests/server/api/routers/v1/test_spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ async def test_span_round_tripping_with_docs(
dialect: str,
span_data_with_documents: Any,
) -> None:
# if dialect == "sqlite":
# pytest.xfail("TODO: Convert this to an integration test")

df = cast(pd.DataFrame, px_client.get_spans_dataframe())
new_ids = {span_id: getrandbits(64).to_bytes(8, "big").hex() for span_id in df.index}
for span_id_col_name in ("context.span_id", "parent_id"):
Expand Down

0 comments on commit 7b0bcbc

Please sign in to comment.