Skip to content

DATA-1988 - Make file ext manadatory for binary_data_capture_upload, update docstrings #483

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
merged 1 commit into from
Nov 16, 2023
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
9 changes: 5 additions & 4 deletions src/viam/app/data_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ async def binary_data_capture_upload(
component_type: str,
component_name: str,
method_name: str,
file_extension: str,
method_parameters: Optional[Mapping[str, Any]] = None,
tags: Optional[List[str]] = None,
data_request_times: Optional[Tuple[datetime, datetime]] = None,
file_extension: Optional[str] = None,
) -> str:
"""Upload binary sensor data.

Expand All @@ -453,12 +453,13 @@ async def binary_data_capture_upload(
component_type (str): Type of the component used to capture the data (e.g., "movement_sensor").
component_name (str): Name of the component used to capture the data.
method_name (str): Name of the method used to capture the data.
file_extension (str): The file extension of binary data including the period, e.g. .jpg, .png, .pcd.
The backend will route the binary to its corresponding mime type based on this extension. Files with a .jpeg, .jpg,
or .png extension will be saved to the images tab.
method_parameters (Optional[Mapping[str, Any]]): Optional dictionary of method parameters. No longer in active use.
tags (Optional[List[str]]): Optional list of tags to allow for tag-based data filtering when retrieving data.
data_request_times (Optional[Tuple[datetime.datetime, datetime.datetime]]): Optional tuple containing `datetime`s objects
denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor.
file_extension (str): The file extension of binary data including the period, e.g. .jpg, .png, .pcd.
The backend will route the binary to its corresponding mime type based on this extension.

Raises:
GRPCError: If an invalid part ID is passed.
Expand Down Expand Up @@ -592,7 +593,7 @@ async def file_upload(
provided.
method_parameters (Optional[str]): Optional dictionary of the method parameters. No longer in active use.
file_extension (Optional[str]): Optional file extension. The empty string "" will be assigned as the file extension if one isn't
provided.
provided. Files with a .jpeg, .jpg, or .png extension will be saved to the images tab.
tags (Optional[List[str]]): Optional list of tags to allow for tag-based filtering when retrieving data.
data (Optional[bytes]): Optional bytes representing file data to upload.

Expand Down