Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Jan 14, 2025
1 parent a3acf22 commit f472d01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions validation_service_api/validation_service/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,9 +1042,9 @@ class ValidationTestSummary(BaseModel):
score_type: ScoreType = None

@classmethod
def from_kg_query(cls, item, client):
def from_kg_query(cls, item, user_client, service_client=None):
item.pop("@context")
item["id"] = client.uuid_from_uri(item["uri"])
item["id"] = user_client.uuid_from_uri(item["uri"])
space = item.get("project_id", None) # what the query calls "project_id" is really the space
if space:
item["project_id"] = project_id_from_space(space)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ def _query_results(filters, kg_user_client, data_model, query_label, from_index,
for filter in filters:
response = kg_client.query(query, filter,
from_index=0, size=100000, scope="any",
use_stored_query=True)
id_key="uri", use_stored_query=True)
for item in response.data:
items[item["uri"]] = item
if len(items) >= size + from_index:
break

test_results = [
data_model.from_kg_query(item, kg_user_client, kg_service_client)
for item in items.values()[from_index:from_index + size]
for item in list(items.values())[from_index:from_index + size]
]

if user.is_anonymous:
Expand Down

0 comments on commit f472d01

Please sign in to comment.