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

Support Collection as a resource in agent and bring on par with latest changes in core library #153

Merged
merged 19 commits into from
Aug 31, 2020

Conversation

priyanshunayan
Copy link
Member

Fixes #152

Checklist

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

Description

This PR enables the agent to adapt to latest changes in core and hydrus.

Change logs

# Building the the collection id, i.e. vocab:Entrypoint/Collection
# TODO build the correct collection id from the resource
# Earlier it used to come as collection/<id> now it comes as class/<id>
redis_collection_id = self.vocabulary + \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xadahiya @chrizandr Earlier when we hit /DroneCollection/<id> we used to get one instance of Drone and thus we used to update the DroneCollection member in redis. But according to the latest changes in hydrus, /Drone/<id> returns the instance of the Drone. So how do we know of which collection this class instance will belong to in order to update the redis cache?

Copy link
Member

@chrizandr chrizandr Aug 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drone/<id> should be used for Drone instances. DroneCollection/<id> should be used for collection instances. Collections only contain hydra:Links, so you never update a class instance at the collection. You only update at Drone/<id> to update the drone.

@priyanshunayan
Copy link
Member Author

priyanshunayan commented Aug 23, 2020

To make reviewing easier I am attaching the snapshot of the redis graph.
graph-6

Also, I took the liberty of upgrading python versions to 3.6 and above on travis because lack of variable annotation support in 3.5

@priyanshunayan priyanshunayan changed the title Bring on par with core Support Collection as a resource in agent and bring on par with latest changes in core library Aug 23, 2020
Copy link
Member

@chrizandr chrizandr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still based on the older version of agent without the generalisation of sync mechanism, can you update this?

Also add some sample code somewhere to how we can now use the agent to do operations on collections/create new collections, etc

@chrizandr chrizandr merged commit ea029a0 into HTTP-APIs:develop Aug 31, 2020
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.

2 participants