Skip to content

DATA-3443: Add export_tabular_data to data client - #800

Merged
Katie Peters (katiepeters) merged 12 commits into
viamrobotics:mainfrom
katiepeters:DATA-3443
Dec 17, 2024
Merged

Katie Peters (katiepeters) merged 12 commits into
viamrobotics:mainfrom
katiepeters:DATA-3443

Conversation

@katiepeters

@katiepeters Katie Peters (katiepeters) commented Dec 11, 2024 •

Copy link
Copy Markdown
Member

This PR adds the new Data endpoint ExportTabularData to the python SDK.

Comment thread src/viam/app/data_client.py Outdated
request = ExportTabularDataRequest(
part_id=part_id, resource_name=resource_name, resource_subtype=resource_subtype, method_name=method_name, interval=interval
)
return await self._data_client.ExportTabularData(request, metadata=self._metadata)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ExportTabularDataResponse has a lot of data in it that is maybe not needed? Which fields on the response would the user actually care about? Is it only the payload? Or also tags?

payload is a proto.Struct, which has really bad UI. We should avoid using that where we can, so we should determine what's actually important to return

@katiepeters Katie Peters (katiepeters) Dec 12, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There's a note in the scope to optionally only return the payload in the future. As for the comment regarding proto.Struct, probably best for us to talk in person, so I'll wander over to your area again at some point!

@katiepeters
Katie Peters (katiepeters) requested review from a team, itsnoelrae and Vijay Vuyyuru (vijayvuyyuru) and removed request for a team December 12, 2024 19:06

@njooma Naveed Jooma (njooma) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great, thanks!

Comment thread src/viam/app/data_client.py Outdated
tags: List[str]
"""A list of tags associated with the data point"""

payload: Mapping[str, Any]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Because this payload is coming from a proto.Struct, you might want to make this Mapping[str, ValueTypes] (from viam.utils import ValueTypes)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These changes look good to me, but will defer to anything the SDK team says on this. Thanks Katie!

@katiepeters
Katie Peters (katiepeters) merged commit 0128ba8 into viamrobotics:main Dec 17, 2024
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.

4 participants