Skip to content

Commit

Permalink
chore: restrict concurrency of ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesGuthrie committed Jan 10, 2025
1 parent 357f0e9 commit 411f485
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on: [pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test-extension:
services:
Expand Down
2 changes: 1 addition & 1 deletion projects/extension/tests/contents/output16.expected
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ CREATE EXTENSION
table ai.vectorizer_errors
view ai.secret_permissions
view ai.vectorizer_status
(92 rows)
(93 rows)

Table "ai._secret_permissions"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
Expand Down
16 changes: 10 additions & 6 deletions projects/pgai/tests/vectorizer/test_vectorizer_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,28 +1014,32 @@ def test_vectorization_successful_with_null_contents(
@pytest.mark.parametrize(
"embedding",
[
("openai/text-embedding-3-small", 1536, {}),
("voyage/voyage-3-lite", 512, {}),
("mistral/mistral-embed", 1024, {}),
("cohere/embed-english-v3.0", 1024, {}),
("openai/text-embedding-3-small", 1536, {}, "OPENAI_API_KEY"),
("voyage/voyage-3-lite", 512, {}, "VOYAGE_API_KEY"),
("mistral/mistral-embed", 1024, {}, "MISTRAL_API_KEY"),
("cohere/embed-english-v3.0", 1024, {}, "COHERE_API_KEY"),
(
"huggingface/microsoft/codebert-base",
768,
{"wait_for_model": True, "use_cache": False},
"HUGGINGFACE_API_KEY",
),
],
)
def test_litellm_vectorizer(
source_table: str,
cli_db: tuple[TestDatabase, Connection],
cli_db_url: str,
embedding: tuple[str, int, dict[str, Any]],
embedding: tuple[str, int, dict[str, Any], str],
vcr_: Any,
test_params: tuple[int, int, int, str, str],
):
model, dimensions, extra_options = embedding
model, dimensions, extra_options, api_key_name = embedding
function = "embedding_litellm"

if api_key_name not in os.environ:
pytest.skip(f"environment variable '{api_key_name}' unset")

embedding_str = f"{function}('{model}', {dimensions}, extra_options => '{json.dumps(extra_options)}'::jsonb)" # noqa: E501 Line too long

vectorizer_id = configure_vectorizer(
Expand Down

0 comments on commit 411f485

Please sign in to comment.