Skip to content

Commit

Permalink
Merge pull request #77 from singnet/imp/add-kwargs-parameter
Browse files Browse the repository at this point in the history
Add kwargs parameter in get_links() method
  • Loading branch information
marcocapozzoli authored Mar 6, 2024
2 parents a16055a + dcd5b5e commit 60b0842
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions das-query-engine/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ def get_links(
link_type: str,
target_types: List[str] = None,
link_targets: List[str] = None,
kwargs={},
) -> List[str] | List[Dict]:
return self.distributed_atom_space.get_links(
link_type,
target_types,
link_targets,
**kwargs,
)

@remove_none_args
Expand Down
5 changes: 4 additions & 1 deletion das-query-engine/validators/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ class GetLinksValidator(PayloadValidator):
link_type = datatypes.String(required=True)
target_types = datatypes.Array(required=False)
link_targets = datatypes.Array(required=False)

kwargs = datatypes.Function(
lambda value, *args, **kwargs: isinstance(value, dict) if value is not None else True,
required=False,
)

class GetIncomingLinksValidator(PayloadValidator):
strict = True
Expand Down

0 comments on commit 60b0842

Please sign in to comment.