Skip to content

DOCS-2347: Update example on GetLatestTabularData #807

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/viam/app/data_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,21 @@ async def get_latest_tabular_data(

::

time_captured, time_synced, payload = await data_client.get_latest_tabular_data(
part_id="<PART-ID>",
resource_name="<RESOURCE-NAME>",
resource_subtype="<RESOURCE-SUBTYPE>",
method_name="<METHOD-NAME>"
tabular_data = await data_client.get_latest_tabular_data(
part_id="77ae3145-7b91-123a-a234-e567cdca8910",
Copy link
Member

Choose a reason for hiding this comment

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

(q) is this a real part-id? Is there any reason we might want to redact it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a real part-id!

resource_name="camera-1",
resource_subtype="rdk:component:camera",
method_name="GetImage"
)

if tabular_data:
time_captured, time_synced, payload = tabular_data
print(f"Time Captured: {time_captured}")
print(f"Time Synced: {time_synced}")
print(f"Payload: {payload}")
else:
print(f"No data returned: {tabular_data}")

Args:
part_id (str): The ID of the part that owns the data.
resource_name (str): The name of the requested resource that captured the data. Ex: "my-sensor".
Expand Down
Loading