Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the bug in the CI where plugins are skipping tests. #2470

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Plugin Testing
run: |
export PYTHONPATH=./
if [ -f "plugins/${{ matrix.plugin }}/plugin_test" ]; then
if [ -d "plugins/${{ matrix.plugin }}/plugin_test" ]; then
pytest --cov=superduper --cov-report=xml plugins/${{ matrix.plugin }}/plugin_test
else
echo "Skipping tests for ${{ matrix.plugin }}, no test file found."
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix the post like in the service vector_search.
- Fix the conflict of the same identifier during encoding.
- Fix the issue where MongoDB did not create the output table.
- Fix the bug in the CI where plugins are skipping tests.

#### New Features & Functionality

Expand Down
9 changes: 4 additions & 5 deletions plugins/mongodb/plugin_test/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest
from superduper.base.document import Document
from superduper.components.schema import Schema
from superduper.components.table import Table
from superduper.ext.numpy.encoder import array

from superduper_mongodb.query import MongoQuery
Expand Down Expand Up @@ -41,16 +42,14 @@ def test_mongo_schema(db, schema):
"z": z,
},
db=db,
schema=schema,
)
)

db.add(schema)
table = Table(identifier=collection_name, schema=schema)
db.add(table)
gt = data[0]

db.execute(
MongoQuery(db=db, table=collection_name).insert_many(data),
)
db[collection_name].insert_many(data).execute()
r = db[collection_name].find_one().execute()
rs = list(db[collection_name].find().execute())

Expand Down
2 changes: 1 addition & 1 deletion plugins/mongodb/superduper_mongodb/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def _execute_find_one(self, parent):
r = self._execute_select(parent)
if r is None:
return
return Document.decode(r, db=self.db)
return Document.decode(r, db=self.db, schema=self._get_schema())

def _execute_insert_one(self, parent):
insert_part = self.parts[0]
Expand Down
2 changes: 1 addition & 1 deletion superduper/backends/base/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def _prepare_documents(self):
r.pop(KEY_BUILDS)
r.pop(KEY_BLOBS)
r.pop(KEY_FILES)
r.pop(KEY_SCHEMA)
r.pop(KEY_SCHEMA, None)
return documents

# TODO deprecate (self.table)
Expand Down
Loading