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

[RSDK-3634] Implement data.proto APIs that Add/Remove Tags #334

Merged
1 commit merged into from Jun 30, 2023
Merged

[RSDK-3634] Implement data.proto APIs that Add/Remove Tags #334

1 commit merged into from Jun 30, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jun 27, 2023

This PR implements and adds docstrings to the gRPC methods that'll allow a DataClient to send a gGRPC request to app to add, remove, and retrieve tags. The PR also implements a function to retrieve bounding box labels. There are a few other minor changes throughout. Namely, some function signatures are updated to include defaults for certain parameters (i.e. empty filter), and the AppClient "close()" function is implemented with logging.

@ghost ghost requested review from njooma and stuqdog June 27, 2023 20:35
@ghost ghost self-requested a review as a code owner June 27, 2023 20:35
src/viam/app/client.py Outdated Show resolved Hide resolved
src/viam/app/data/client.py Outdated Show resolved Hide resolved
src/viam/app/data/client.py Outdated Show resolved Hide resolved
src/viam/app/data/client.py Outdated Show resolved Hide resolved
@ghost ghost requested a review from njooma June 27, 2023 21:07
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

One nit, but on first pass looks good!

src/viam/app/client.py Show resolved Hide resolved
@ghost ghost requested a review from stuqdog June 28, 2023 19:50
@stuqdog
Copy link
Member

stuqdog commented Jun 29, 2023

@8ashar per this PR, {add|remove}_tags_by_file_id is going to become ..._by_id instead. Might be good to change the user-facing method names now, just so it's always consistent.

Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

LGTM but I'm requesting that we change the user-facing API of the *_by_file_ids methods to instead be *_by_ids, and update the args/comments appropriately. The methods are changing name and we should fix the user-facing experience to match right away, then update the methods once the new protos go into effect.

See this pr for details.

Edit: in addition, we should change the actual argument structure. Right now we're passing file IDs (which are strings) into a deprecated file_id field that isn't looked at. What we should pass are BinaryIDs (which are a proto type BinaryID and which include, among other things, an optional file_id) into the binary_id field that is looked at.

@ghost ghost requested a review from stuqdog June 29, 2023 16:00
src/viam/app/data/client.py Outdated Show resolved Hide resolved
src/viam/app/client.py Outdated Show resolved Hide resolved
src/viam/app/client.py Outdated Show resolved Hide resolved
src/viam/app/data/client.py Show resolved Hide resolved
src/viam/app/data/client.py Outdated Show resolved Hide resolved
@ghost ghost requested a review from stuqdog June 29, 2023 17:24
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

One comment that can definitely be pushed to a subsequent PR. Also: we should hold off on merging this until the data proto updates have been merged.

src/viam/app/data/client.py Show resolved Hide resolved
@ghost ghost requested a review from stuqdog June 29, 2023 18:41
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

We should coordinate release timing between this, the other data API PR, and the proto updates, but LGTM! Thanks for pulling this together.

GRPCError: if no binary_ids or tags are provided
"""
request = AddTagsToBinaryDataByIDsRequest(binary_ids=binary_ids, tags=tags)
_: AddTagstoBinaryDataByIDsResponse = await self._data_client.AddTagsToBinaryDataByIDs(request, metadata=self._metadata)
Copy link
Member

Choose a reason for hiding this comment

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

oh tiny nit here, s/AddTagstoBinaryDataByIDsResponse/AddTags**T**oBinaryDataByIDsResponse

Copy link
Author

Choose a reason for hiding this comment

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

oouh nice catch

@ghost ghost merged commit ef633e7 into viamrobotics:main Jun 30, 2023
5 checks passed
@ghost ghost deleted the RSDK-3634/data.proto branch June 30, 2023 19:56
This pull request was closed.
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