Skip to content

Commit

Permalink
DATA-1988 - Make file ext manadatory for binary_data_capture_upload, …
Browse files Browse the repository at this point in the history
…update docstrings (viamrobotics#483)
  • Loading branch information
stuqdog authored Nov 16, 2023
1 parent 1f9d469 commit a638bad
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/viam/app/data_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,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 @@ -497,12 +497,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 @@ -693,7 +694,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

0 comments on commit a638bad

Please sign in to comment.