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

Implement search mechanism #403

Merged
merged 13 commits into from
Jun 28, 2019
Merged

Conversation

vddesai1871
Copy link
Contributor

@vddesai1871 vddesai1871 commented Jun 21, 2019

Fixes #302

Checklist

  • My branch is up-to-date with upstream/develop branch.
  • Everything works and tested for Python 3.5.2 and above.

Description

Add searching mechanism to hydrus with help of IriTemplate.

Change logs

Added functions in helpers.py to generate IriTemplate for collections.
Added functions in crud.py to filter collections according to search parameters.

Search Example

It pretty much (or maybe completely) follows the procedure mentioned in the spec. To test it

  1. Dereference any Collection endpoint(DroneCollection for example).
  2. The response will contain IriTemplate attached to the search property.
  3. The IriTemplate will have different IriTemplateMapping for each variable. You can use any combination of these variables to search the collection. (To name nested properties we follow a simple convention. They are represented as PropertyTitle[NestedPropertyTitle], so the variable to search drones by speed would be named as DroneState[Speed], the spec doesn't mention anything about it)

@vddesai1871 vddesai1871 marked this pull request as ready for review June 25, 2019 13:37
hydrus/data/crud.py Outdated Show resolved Hide resolved
hydrus/data/crud.py Outdated Show resolved Hide resolved
hydrus/data/crud.py Outdated Show resolved Hide resolved
hydrus/tests/test_crud.py Show resolved Hide resolved
@vddesai1871
Copy link
Contributor Author

Also, can you take a look at the path variable in the get_collection method (crud.py)? I think we can remove it.

@xadahiya
Copy link
Member

According to resources.py path should never be None. Am I missing something? Can you please run a couple of tests and remove it if it's redundant?

@xadahiya
Copy link
Member

@vddesai1871 Good to merge?

@vddesai1871
Copy link
Contributor Author

Good to merge?

Yes, I pulled Hydra:Error changes and added an exception for handling invalid parameters. Now I think it's solid.

@xadahiya xadahiya dismissed their stale review June 28, 2019 09:48

Changes done

@xadahiya xadahiya merged commit 54f5ae6 into HTTP-APIs:develop Jun 28, 2019
@Mec-iS
Copy link
Contributor

Mec-iS commented Jul 3, 2019

Do we have all the changes in python-hydra-core master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants