chore: Resolve typo in getting documents code
Resolve typo in code chore COG-912
This commit is contained in:
parent
63c3dceec6
commit
48825d0d84
2 changed files with 3 additions and 4 deletions
|
|
@ -21,7 +21,7 @@ async def get_document_ids_for_user(user_id: UUID, datasets: list[str] = None) -
|
||||||
)).all()
|
)).all()
|
||||||
|
|
||||||
if datasets:
|
if datasets:
|
||||||
documnets_ids_in_dataset = set()
|
documents_ids_in_dataset = set()
|
||||||
# If datasets are specified filter out documents that aren't part of the specified datasets
|
# If datasets are specified filter out documents that aren't part of the specified datasets
|
||||||
for dataset in datasets:
|
for dataset in datasets:
|
||||||
# Find dataset id for dataset element
|
# Find dataset id for dataset element
|
||||||
|
|
@ -45,6 +45,6 @@ async def get_document_ids_for_user(user_id: UUID, datasets: list[str] = None) -
|
||||||
|
|
||||||
# If document is related to dataset added it to return value
|
# If document is related to dataset added it to return value
|
||||||
if data_id:
|
if data_id:
|
||||||
documnets_ids_in_dataset.add(document_id)
|
documents_ids_in_dataset.add(document_id)
|
||||||
return list(documnets_ids_in_dataset)
|
return list(documents_ids_in_dataset)
|
||||||
return document_ids
|
return document_ids
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,6 @@ async def main():
|
||||||
assert len(document_ids) == 1, f"Number of expected documents doesn't match {len(document_ids)} != 1"
|
assert len(document_ids) == 1, f"Number of expected documents doesn't match {len(document_ids)} != 1"
|
||||||
|
|
||||||
# Test getting of documents for search when no dataset is provided
|
# Test getting of documents for search when no dataset is provided
|
||||||
from cognee.modules.users.permissions.methods import get_document_ids_for_user
|
|
||||||
user = await get_default_user()
|
user = await get_default_user()
|
||||||
document_ids = await get_document_ids_for_user(user.id)
|
document_ids = await get_document_ids_for_user(user.id)
|
||||||
assert len(document_ids) == 2, f"Number of expected documents doesn't match {len(document_ids)} != 2"
|
assert len(document_ids) == 2, f"Number of expected documents doesn't match {len(document_ids)} != 2"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue