Skip to content

Commit a638bad

Browse files
authored
DATA-1988 - Make file ext manadatory for binary_data_capture_upload, update docstrings (#483)
1 parent 1f9d469 commit a638bad

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/viam/app/data_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,10 @@ async def binary_data_capture_upload(
481481
component_type: str,
482482
component_name: str,
483483
method_name: str,
484+
file_extension: str,
484485
method_parameters: Optional[Mapping[str, Any]] = None,
485486
tags: Optional[List[str]] = None,
486487
data_request_times: Optional[Tuple[datetime, datetime]] = None,
487-
file_extension: Optional[str] = None,
488488
) -> str:
489489
"""Upload binary sensor data.
490490
@@ -497,12 +497,13 @@ async def binary_data_capture_upload(
497497
component_type (str): Type of the component used to capture the data (e.g., "movement_sensor").
498498
component_name (str): Name of the component used to capture the data.
499499
method_name (str): Name of the method used to capture the data.
500+
file_extension (str): The file extension of binary data including the period, e.g. .jpg, .png, .pcd.
501+
The backend will route the binary to its corresponding mime type based on this extension. Files with a .jpeg, .jpg,
502+
or .png extension will be saved to the images tab.
500503
method_parameters (Optional[Mapping[str, Any]]): Optional dictionary of method parameters. No longer in active use.
501504
tags (Optional[List[str]]): Optional list of tags to allow for tag-based data filtering when retrieving data.
502505
data_request_times (Optional[Tuple[datetime.datetime, datetime.datetime]]): Optional tuple containing `datetime`s objects
503506
denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor.
504-
file_extension (str): The file extension of binary data including the period, e.g. .jpg, .png, .pcd.
505-
The backend will route the binary to its corresponding mime type based on this extension.
506507
507508
Raises:
508509
GRPCError: If an invalid part ID is passed.
@@ -693,7 +694,7 @@ async def file_upload(
693694
provided.
694695
method_parameters (Optional[str]): Optional dictionary of the method parameters. No longer in active use.
695696
file_extension (Optional[str]): Optional file extension. The empty string "" will be assigned as the file extension if one isn't
696-
provided.
697+
provided. Files with a .jpeg, .jpg, or .png extension will be saved to the images tab.
697698
tags (Optional[List[str]]): Optional list of tags to allow for tag-based filtering when retrieving data.
698699
data (Optional[bytes]): Optional bytes representing file data to upload.
699700

0 commit comments

Comments
 (0)