Skip to content

Commit

Permalink
chore: get rid of nested parametrization (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Askir authored Jan 27, 2025
1 parent 41cb52c commit 0a399e2
Show file tree
Hide file tree
Showing 10 changed files with 212 additions and 442 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from testcontainers.postgres import PostgresContainer # type: ignore

from pgai.sqlalchemy import vectorizer_relationship
from tests.vectorizer.extensions.utils import run_vectorizer_worker
from tests.vectorizer.utils import run_vectorizer_worker


class BaseModel(DeclarativeBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from testcontainers.postgres import PostgresContainer # type: ignore

from pgai.sqlalchemy import vectorizer_relationship
from tests.vectorizer.extensions.utils import run_vectorizer_worker
from tests.vectorizer.utils import run_vectorizer_worker


def test_sqlalchemy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from testcontainers.postgres import PostgresContainer # type: ignore

from pgai.sqlalchemy import vectorizer_relationship
from tests.vectorizer.extensions.utils import run_vectorizer_worker
from tests.vectorizer.utils import run_vectorizer_worker


class Base(DeclarativeBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from testcontainers.postgres import PostgresContainer # type: ignore

from pgai.sqlalchemy import vectorizer_relationship
from tests.vectorizer.extensions.utils import run_vectorizer_worker
from tests.vectorizer.utils import run_vectorizer_worker


class Base(DeclarativeBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from testcontainers.postgres import PostgresContainer # type: ignore

from pgai.sqlalchemy import vectorizer_relationship
from tests.vectorizer.extensions.utils import run_vectorizer_worker
from tests.vectorizer.utils import run_vectorizer_worker


class Base(DeclarativeBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
from testcontainers.postgres import PostgresContainer # type: ignore

from pgai.sqlalchemy import vectorizer_relationship
from tests.vectorizer.extensions.utils import (
run_vectorizer_worker,
)
from tests.vectorizer.utils import run_vectorizer_worker


class Base(DeclarativeBase):
Expand Down
18 changes: 0 additions & 18 deletions projects/pgai/tests/vectorizer/extensions/utils.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
from pathlib import Path
from typing import Any

from click.testing import CliRunner
from sqlalchemy import Column

from pgai.cli import vectorizer_worker
from tests.vectorizer.extensions.conftest import load_template


def run_vectorizer_worker(db_url: str, vectorizer_id: int) -> None:
CliRunner().invoke(
vectorizer_worker,
[
"--db-url",
db_url,
"--once",
"--vectorizer-id",
str(vectorizer_id),
"--concurrency",
"1",
],
catch_exceptions=False,
)


def create_vectorizer_migration(
migrations_dir: Path,
table_name: str,
Expand Down
Loading

0 comments on commit 0a399e2

Please sign in to comment.