-
Notifications
You must be signed in to change notification settings - Fork 64
[RSDK-3897] Update Data Docs #359
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass, some comments/questions but generally looking good!
docs/examples/_data_server.py
Outdated
) | ||
|
||
|
||
class DataServer(DataServiceBase, DataSyncServiceBase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely certain I understand what this class is doing. Can you clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! This is another mock data service (similar to the one that had to be created in the testing ticket). This one is used for the example documentation. This server runs on a local port and pretends to be app and feeds our example data_client--the one included in the example notebook and so displayed on our docs page--fake data just to display. This is used because we can't actually authenticate and connect to app because we don't want to include a real location secret or robot uri in the docs pages or in the python repo.
Put differently, the example page writes a function that shows how to instantiate an AppClient. We don't actually call this function though, because we know it would fail since we aren't providing real location secrets or URIs. Instead, I depend on a fake mock AppClient that directly connects its DataClient to this server^ to give the reader the illusion of a data client. Any code that would 'reveal' this illusion is marked to be hidden and so won't show up on the html page, but it's still in the repo (and still runs and shouldn't cause any error at all).
That is all!
docs/examples/example.ipynb
Outdated
"source": [ | ||
"from viam.proto.app.data import Filter\n", | ||
"\n", | ||
"data = await data_client.tabular_data_by_filter(filter=Filter(robot_name=\"arduino\"))\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we flesh out this Filter
some more? Would love to show how all fields are set, or at a minimum the non-obvious fields (timestamps, tags).
…hen creating an AppClient.
src/viam/app/client.py
Outdated
Self: the AppClient. | ||
Self: The `AppClient`. | ||
""" | ||
assert dial_options.credentials.type == "robot-location-secret" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct right now when we only have two credential types, but I think will be wrong when we add new types (org, user, etc.). Would prefer to assert that type is not equal to robot-secret
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
This PR makes a bunch of edits to the AppClient and DataClient docstrings and adds a section to the example Jupyter notebook showing how to use both classes.